Hi everyone,
I know its a basic problem, but realloc doesnt seem to be resizing my array to the right size.
Code:
char* nickBuf=NULL;
int reallocLength = 1024 + nickLength +1;
printf("size of reallocLength is: %d\n", reallocLength);
void *_tmp = realloc(nickBuf, reallocLength);
nickBuf=(char*)_tmp;
printf("size of bufPlusNick inside if loop is: %d\n", sizeof(nickBuf));
//nickBuf is freed later on in code
various printf statements i have have printed out the following
size of reallocLength is: 2045
size of nickBuf inside if loop is: 4
size of nickLength is: 1020
size of nickBuf is: 4
im unsure how realloc can resize the array to only 4, when an int of 2045 is given as the argument
thanks for any help