Dynamic Memmory Allocation

malloc()              The malloc()  function dynamically allocates memory when required. This function allocates ‘size’ byte of memory and returns a pointer to the first byte or NULL if there is some kind of error.The storage is not initialized. For example:               int *ptr = malloc(sizeof(int) * 10);      // allocates 10 ints!                  If it is unable to […]


 Union is a data type with two or more member similar to structure but in this case all the members share a common memory location. The size of the union corresponds to the length of the largest member. Since the member share a common location they have the same starting address.                     The real purpose of unions […]


Web page Under construction! The following functions compose the Borland Graphics Interface and are usually available for 16 bit DOS applications. Use them to create onscreen graphics with text. They are defined in graphics.h. #include<stdio.h> #include<conio.h> #include<graphics.h> int main() { int gd=DETECT,gm; initgraph(&gd;,&gm;,”f:\\tc\\bgi”); getch(); closegraph(); /* closes down the graphics system */ return 0; } […]

Goto statement

The goto statement is used to alter the normal sequence of program execution by transferring control to some other part of the program unconditionally. In its general form, the goto statement is written as goto label;                    where the label is an identifier that is used to label the target statement to which the control […]


                          A string in C is actually a character array. As an individual character variable can store only one character, we need an array of characters to store strings. Thus, in C string is stored in an array of characters. Each character in a string occupies one location in an array. The null character ‘\0’ […]