Im trying to read in a file to a char * with fread, but after it is done there is junk at the end, how can i fix this.
Here is an excert from my class
Code:void mikestring::readfile(char * filename) { FILE* f = fopen(filename,"rb"); fseek (f , 0 , SEEK_END); long fileSize = ftell (f); rewind (f); delete[] mystring; //Clear Old Memmory MyLen = fileSize; MyCap = MyLen+1; mystring = new char[fileSize]; fread (mystring,1,fileSize,f); fclose(f); }