Im reading from a file with getline (file,line1); and i have a null character after every end of line.
But i would like to append some string to it so i dont want the null character.
How can we remove newline char in c++?
Code:while(file.good()) { getline (file,line1); str = "hello"; str += line1; str += "world"; cout << str << endl; }