0

ok so here the problem the code works just adds break on to every line i want it to only add breaks to the line that don't alraedy have spaces after them.

while (! fileIn.eof() )
   {

    getline (fileIn, linea);
    fileOut << linea << b <<endl;




   }//end while

is what im working with right now.

Edited by Dani: Formatting fixed

3
Contributors
2
Replies
3
Views
6 Years
Discussion Span
Last Post by WaltP
0

you can write function witch trims spaces from lines ends or you can use isspace() function to indetify spaces, you ll find it in cctype header file

0

ok so here the problem the code works just adds break on to every line i want it to only add breaks to the line that don't alraedy have spaces after them.

OK so you say you have a problem then you say the code works and it just does something about break but you don't say what break means and what spaces have to do with anything the code you posted without code tags by the way you need to use them doesn't do anything with spaces nor breaks so we don't have any idea what you are really doing you might want to explain in detail what you are trying to do also explain what the code does wrong be explicit and also write in real english you know sentences punctuation and so on so we can understand what you are writing

Edited by WaltP: n/a

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.