Hi Guys,
I read the following in the FAQ:
Please tell me if I got it right:Originally Posted by FAQ
1.
I CAN'T rely on calloc to Zero fill memory with floating points??
The result I get is 0.Code:float *pArr; int i; for (i=0;i<10;++i) { pArr=calloc(sizeof(*pArr),10); printf("%f\n",pArr[i]); }
2.
I CAN'T rely on calloc to Zero fill memory where pointers point to??
Again the result is 0.Code:float *pArr[10]; int i; for (i=0;i<10;++i) { pArr[i]=calloc(sizeof(float *),10); printf("%f\n",*pArr[i]); }
3. CAN I rely that calloc will Zero fill memory for int , char ,long??
Many thanks for your help



LinkBack URL
About LinkBacks



