unions in c

unions in c A union is a special data type available in C that enables you 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...

structure definition in c

structure definition in c To define a structure, you must use the struct statement. The struct statement defines a new data type, with more than one member for your program. The format of the struct statement is this: struct [structure tag] { member definition; member...

structures in c

structures in c C arrays allow you to define type of variables that can hold several data items of the same kind but structure is another user defined data type available in C programming, which allows you to combine data items of different kinds. Structures are used...

Pointers and arrays in c

Pointers and arrays in c Before we understand the concept of arrays of pointers, let us consider the following example, which makes use of an array of 3 integers: #include <stdio.h> const int MAX = 3; int main () { int var[] = {10, 100, 200}; int i; for (i = 0;...

Pointers arithmetic in c

Pointers arithmetic in c As explained in main chapter, C pointer is an address, which is a numeric value. Therefore, you can perform arithmetic operations on a pointer just as you can a numeric value. There are four arithmetic operators that can be used on pointers:...

pointers in c

pointers in c Pointers in C are easy and fun to learn. Some C programming tasks are performed more easily with pointers, and other tasks, such as dynamic memory allocation, cannot be performed without using pointers. So it becomes necessary to learn pointers to become...