int size; char *fileData; ifstream file("big.txt"); file.seekg(0, ios::end); size = file.tellg(); file.seekg(0, ios::beg); fileData = new char [size]; file.read(fileData,size); file.close(); cout << fileData << endl; Why fileData write garbage at the end of the line ( size calculated correctly)?