   C++ file read endfinte loop
  How can I make a file be read from begining to end and back again tell I exit the program? I want to display the text in a file continusley.Like say I load a txt file I read its contents from top to bottom but then I want it to start at the top again ect tell I exit the program.   
  Which part are you having difficulty with?bool quit = false;do{ /* print file */ if( /* check input */ )   quit = true;}while( !quit );;  this is an inner loop so I have to use the if statment but I kind of figured this should work but its not displaying anything at allif(!dataFile.eof()){  dataFile.getline(fileInput,TSize);   cout<<fileInput;}  else  {   dataFile.clear();   dataFile.seekg(0L,ios::beg);  };  Never mind it works now it was just the way I was opening the text file.   ;  Read the file once, store it's content in memory, and then display that ad infinitum. Accessing memory is more efficient than accessing the hard-drive.That may not be an issue for a small toy program, but it's something to keep in mind for real-life scenario's. Just saying. ;)   