R0b0t1
2007-12-22 00:28:59
I'm reading a file character by character, and I want to add an element to a character array to place the new input in… this is what I have so far.
Anyone have a better idea/fix?
EDIT: What this does is the size of a char * number of elements in the array + the length of one byte. Will this work?
fileText = realloc(fileText, sizeof(char)*((sizeof(fileText)/(sizeof(char)))+sizeof(char)));
Anyone have a better idea/fix?
EDIT: What this does is the size of a char * number of elements in the array + the length of one byte. Will this work?