   How to stop printing output an resume later
FOR THE MOD THAT CLOSED THE LAST THREAD.. THIS IS NOT HOMEWORK. DONT EVEN JUDGE ME.CAUSE YOU DONT KNOW ME. IF I WNET TO SHCOOL AN HAD HOMEWORK I WOULD DO IT MY SELF.Hello everyone i got a problem with using ifstream to read a certain line i have in a text file.Say i have a text file with three word's.BobjimsamWell what i want to do is call a certain number of lines from a file, then stop on a whitespace an resume at a later timeHeres the some code to.int main(){ifstream myfile("area.txt");string line,buffer[1];const size_t size = sizeof buffer / sizeof *buffer;size_t i = 0;while (getline(myfile,line)){  buffer = line;  if (++i >= size)  {   i=0;  }}for (size_t j = 0; j < size; ++j){  cout << buffer << "\n";  if (++i >= size)  {   i = 0;  }}system("pause");}Now this works. But it reads the last name first. I wanna be able to read the firt name.   
  [font=arial, verdana, tahoma, sans-serif][size=2]I don't understand what you are trying to do, and I am a smart guy: So you probably didn't explain it very well. What "last name" are you talking about? And why do you have all that logic for a buffer of size 1? Perhaps you could post a less degenerate example?[/font]   ;  Cross posting and duplicate posting generally isn't permitted on these forums, especially of closed threads -- I'd recommend taking it up with a moderator instead.For the sake of keeping conversation in one place, this (open) thread already has replies:http://www.gamedev.net/topic/597507-reading-different-lines-in-text-file/;FOR THE MOD THAT CLOSED THE LAST THREAD.. THIS IS NOT HOMEWORK. DONT EVEN JUDGE ME.CAUSE YOU DONT KNOW ME. IF I WNET TO SHCOOL AN HAD HOMEWORK I WOULD DO IT MY SELF.If a moderator closes one of your topics, you DO NOT re-post it without first seeking permission from a moderator -- your topic was closed for a reason.We also prefer that people choose only one forum for each topic and do not cross-post -- you already have a topic (with replies) for this question here.Topic closed.  [color="#FF0000"]DO NOT REPOST IT.   