Hi,
I have a question and need some help with getline. I am opening a file and getting the whole line and putting it in a buffer. Now ofcourse the line contains blank or white spaces and I want to delete all this white spaces only, leaving me with no white space characters only.
for example:
lets say my buffer reads:
p = 1 2 3 4 2 3
I want to delete the white spaces so it will read:
p=123423
I am not sure how to do that. can any one help me out please. Thank you in advance.
p.s.
Here is how I am getting each line.
Code:while(inFile.peek() != EOF) { for(int b =0; b<buffersize; b++) { buffer[b] = '\0'; } inFile.getline(buffer, buffersize); for(int o=0; o<buffersize; o++) {cout<<buffer[o];} cout<<endl; }



LinkBack URL
About LinkBacks


