Category: C

Memory Management

5 / 5 ( 1 vote ) Memory Management  This chapter explains dynamic memory management in C. The C programming language provides several functions for memory allocation and management. These functions can be found in the <stdlib.h> header file. S.N. Function and Description 1 void *calloc(int num, int size); This function allocates an array of […]

Command Line Arguments

Command Line Arguments It is possible to pass some values from the command line to your C programs when they are executed. These values are called command line arguments and many times they are important for your program especially when you want to control your program from outside instead of hard coding those values inside […]

Type Casting in C

Type Casting in C Type casting is a way to convert a variable from one data type to another data type. For example, if you want to store a ‘long’ value into a simple integer, then you can type cast ‘long’ to ‘int’. You can convert the values from one type to another explicitly using […]

Header Files in C

Header Files in C A header file is a file with extension .h which contains C function declarations and macro definitions to be shared between several source files. There are two types of header files: the files that the programmer writes and the files that comes with your compiler. You request to use a header […]

Union in C

Union in C A union is a special data type available in C that allows to store different data types in the same memory location. You can define a union with many members, but only one member can contain a value at any given time. Unions provide an efficient way of using the same memory […]

Structures in C

Structures in C  Arrays allow defining type of variables that can hold several data items of the same kind. Similarly, the structure is another user-defined data type available in C that allows to combine data items of different kinds. Structures are used to represent a record. Suppose you want to keep track of your books […]


Strings Strings are actually one-dimensional array of characters terminated by a null character ‘\0’. Thus a null-terminated string contains the characters that comprise the string followed by a null. The following declaration and initialization create a string consisting of the word “Hello”. To hold the null character at the end of the array, the size […]

Types of arrays in C, Array in PDF

Types of arrays in C, Array in PDF, Two Dimensional array in C, Array Initialization in C, Learn Him Self Arrays in C  Arrays a kind of data structure that can store a fixed-size sequential collection of elements of the same type. An array is used to store a collection of data, but it is […]