Home | Add to Favorites | Ebooks Directory | News  
C ,C++  Programming
Home
C , C ++  Article
C and C++  Tutorial 
C++  compiler
C++  Books
C and C++ Questions
C ++ Coding
C++ Source Code
pointers:

Learn about dynamic memory allocation.

1.malloc

int *p;
p=malloc(1000);                  //malloc (size); p is an array of 500 elements.

default values are garbage values

 

 

2. p=calloc(10,sizeof(int)   //calloc (number of elements, size) takes two arguments. here p is array of 10 elements. default values are zeroes.

3.
free(p)      //  frees the memory allocated.

4.Learn about far, huge, near pointers and their memory size. ordinary pointer  occupies 2 bytes. far pointer 4 bytes.



5.
.Dangling pointers :- Pointers which are created but not assigned any reference .

Go To Index