October 17th, 2012, 08:36 AM
Help (Dynamic memory allocation)
i am beginner in programming. I want to understand dynemic memory allocation function. i search it google but i dont satisified with it... Can anybody plz explain me dynamic memory allocation function.. malloc(),realloc(),calloc() and freee()..
In school mam do this example ..
#define NULL 0
t=(int *)malloc(size * sizeof(int));
printf("No space available");
printf("Display table value");
printf("%d values at %u address",*p,p);
Plzz explain me this example malloc line..
Thank you ..
Plz give me good website for c tutorial :)
October 17th, 2012, 09:14 AM
I doubt you'll find someone whose going to give you a detailed explanation about malloc and company. Could you state exactly what your having problems with? Please be specific or Google your general inquires.
October 17th, 2012, 11:00 AM
October 17th, 2012, 11:36 AM
After discovering that malloc failed your program must avoid dereferencing the NULL pointer.
[/code] are essential for python code and Makefiles!