View Single Post
Old 09-22-07, 06:49 PM   #9
bugmeplz
*BANNED*
 
bugmeplz's Avatar
 
Join Date: Sep 2006
Posts: 427
Default Re: C++ Gurus, School Me :D

Quote:
Originally Posted by six_storm
Ok, I got everything worked out. Now my problem is indentation. I'm supposed to take an input file and meet the following conditions when outputting to the screen and output.txt:

1) When a "{" passes thru, go to the next line and indent 6 spaces.
2) When a "}" passes thru, go to the next line and dedent 6 spaces.
3) If you have a nested or two "{", go to next line and indent 12 spaces.

What I can't figure out is how can you tell your program where the end of the line is to "endl;". Any takers? TIA.
Please pastebin a sample input and what the resulting output should be like so I can better understand what you mean.

http://pastebin.com/ (select c++ syntax highlighting for easier reading)
bugmeplz is offline   Reply With Quote