View Single Post
Join Date: Jul 2008
Posts: 155
Reputation: amrith92 is on a distinguished road 
Solved Threads: 18
amrith92's Avatar
amrith92 amrith92 is offline Offline
Junior Poster

Re: Line count not working....

 
0
  #7
Sep 4th, 2008
Originally Posted by niek_e View Post
Just out of curiosity: You do know that void main() doesn't exist right? I'm referring to your signature...
Originally Posted by raul15791 View Post
Good... Even signature is checked!
Yes, I am aware that void main doesn't exist as a standard, although this does work in older c++ compilers, like the ones I used to use...


Originally Posted by niek_e View Post
If this code were to work at all, it would display the cout line as many times as there are newlines in the file. I suppose that wasn't your intent?
There are a few other things wrong with your program, but I guess this isn't all of it?
Well, the code does do this, and the only reason this exists is to check that the program can actually render the file properly...and it does, it keeps printing the line as many times as it encounter '\n' delimiter.
And you're correct, This is just a part of a bigger program. I'll try your code out and will try and modify my own...

Thanks for all the replies...

[EDIT]Thanks for your code and advice, 'niek_e', it helped such a lot! The code's finally working!!
Last edited by amrith92; Sep 4th, 2008 at 6:44 am. Reason: tested code
"C++ : Where friends have access to your private members."
C++: You accidentally create a dozen instances of yourself and shoot them all in the foot. Providing emergency medical assistance is impossible since you can't tell which are bitwise copies and which are just pointing at others and saying, "That's me, over there."
Reply With Quote