|
-
May 21st, 2012, 10:17 AM
#1
realloc()
{
int*ptr = (int*)malloc(10*sizeof(int));
ptr = realloc(ptr, 20*sizeof(int));
}
As realloc function is used to dynamically reallocate the memory and ptr is a pointer which points the dynamically allocated memory, but in case of realloc function why we have written (ptr, 20*sizeof(int))...
Why we have written ptr here?? Like a malloc function it should be some integer value.
TANUSHREE-AGRAWAL...
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|