I have a string
which i declare like this :
char string[60]="Hello";
fwrite(string, sizeof(string), 1, file);
the problem is, when writing to the file, it not only writes hello, but it also includes the remaining elements which have not been initialised...which leaves me with 50 over other spaces in the file...
i know u would say why not just do
char string[5]="Hello";
but i just want to allocate more in the buffer so i can add more characters in the future...



LinkBack URL
About LinkBacks


