- Trending Categories
Data Structure
Networking
RDBMS
Operating System
Java
MS Excel
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
Physics
Chemistry
Biology
Mathematics
English
Economics
Psychology
Social Studies
Fashion Studies
Legal Studies
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
Found 1401 Articles for C
![Samual Sam](https://www.tutorialspoint.com/assets/profiles/13514/profile/60_83486-1512649303.jpg)
18K+ Views
The sizeof operator is the most common operator in C. It is a compile-time unary operator and used to compute the size of its operand. It returns the size of a variable. It can be applied to any data type, float type, pointer type variables.When sizeof() is used with the data types, it simply returns the amount of memory allocated to that data type. The output can be different on different machines like a 32-bit system can show different output while a 64-bit system can show different of same data types.Here is an example in C language, Example Live Demo#include ... Read More
![karthikeya Boyini](https://www.tutorialspoint.com/assets/profiles/13518/profile/60_31598-1537784993.jpg)
4K+ Views
Typecasting is a method in C language of converting one data type to another.There are two types of typecasting.1.Implicit Type casting − This conversion is done by the compiler. When more than one data type of variables are used in an expression, the compiler converts data types to avoid loss of data.Here is an example of implicit type casting in C language, Example Live Demo#include int main() { int a = 10; char b = 'S'; float c = 2.88; a = a+b; printf("Implicit conversion from character to integer : %d", a); c = ... Read More
![Raju Kumar](https://www.tutorialspoint.com/assets/profiles/14304/profile/60_2507509-1670227651.jpg)
13K+ Views
Variables in C are associated with data type. Each data type requires an amount of memory and performs specific operations.There are some common data types in C −int − Used to store an integer value.char − Used to store a single character.float − Used to store decimal numbers with single precision.double − Used to store decimal numbers with double precision.The following table displays data types in C language −Data TypesBytesRangeshort int2-32, 768 to 32, 767unsigned short int20 to 65, 535unsigned int40 to 4, 294, 967, 295int4-2, 147, 483, 648 to 2, 147, 483, 647long int4-2, 147, 483, 648 to 2, ... Read More
![Samual Sam](https://www.tutorialspoint.com/assets/profiles/13514/profile/60_83486-1512649303.jpg)
10K+ Views
VariablesIn C language, variables are the storage place where some form of data is stored. Different variables require different amount of memory on which a set of operations is applied.A variable name cannot start with a number. It can consist of alphabets, number, underscore “_”.Here is the syntax of declaring variables in C language, type variable_name;Here is the syntax of multiple variables declaration in C language, type variable_name1, variable_name2, variable_name3;The following is an example of variables in C language, Example Live Demo#include int main() { char a1 = 'H'; int b = 90, c = 150; float ... Read More
![Ramu Prasad](https://www.tutorialspoint.com/assets/profiles/13539/profile/60_87996-1512650215.jpg)
4K+ Views
The main reason for segmentation fault is accessing memory that is either not initialized, out of bounds for your program or trying to modify string literals. These may cause a segmentation fault though it is not guaranteed that they will cause a segmentation fault. Here are some of the common reasons for segmentation faults −Accessing an array out of boundsDereferencing NULL pointersDereferencing freed memoryDereferencing uninitialized pointersIncorrect use of the "&" (address of) and "*" (dereferencing) operatorsImproper formatting specifiers in printf and scanf statementsStack overflowWriting to read-only memory
![Chandu yadav](https://www.tutorialspoint.com/assets/profiles/22330/profile/60_142811-1519038104.jpg)
4K+ Views
The compilation of a C++ program consists of three steps −Preprocessing − In simple terms, a C Preprocessor is just a text substitution tool and it instructs the compiler to do required pre-processing before the actual compilation. It handles preprocessing directives like #include, #define, etc.Compilation − The compilation takes place on the preprocessed files. The compiler parses the pure C++ source code and converts it into assembly code. This in turn calls the assembler that converts the assembly code to machine code(binary) as Object files. These Object files can refer to symbols that are not defined. The compiler won't give ... Read More
![Priya Pallavi](https://www.tutorialspoint.com/assets/profiles/13562/profile/60_91320-1512544134.jpg)
9K+ Views
A segmentation fault occurs when your program attempts to access an area of memory that it is not allowed to access. In other words, when your program tries to access memory that is beyond the limits that the operating system allocated for your program.Seg faults are mostly caused by pointers that are −Used to being properly initialized.Used after the memory they point to has been reallocated or freed.Used in an indexed array where the index is outside of the array bounds.
![Ankith Reddy](https://www.tutorialspoint.com/assets/profiles/22328/profile/60_142162-1519038074.jpg)
325 Views
A process dumps core when it is terminated by the operating system due to a fault in the program. The most typical reason this occurs is that the program accessed an invalid pointer value like NULL or some value out of its memory area. As part of that process, the operating system tries to write our information to a file to allow us to analyze what happened.This core can be used as follows to diagnose and debug our program −The core is dumped to the /proc/sys/kernel directory by default. To debug a core, the program must be compiled with the ... Read More