hi
realloc function if i remember correct is like this
i tried using it like thisCode:void *realloc (void *ptr, unsigned int size)
the output isCode:#include <stdio.h> #include <stdlib.h> int main(void){ char *z; z = (char *)malloc(3*sizeof(char)); z = "abc"; z = (char *)realloc(z,2); printf("%s\n",z); free(z); getchar(); return 0; }why? shouldnt it beCode:abc?Code:ab
thanks