+ 2

file handling program to store stuff in a file and then displaying it.

so i wrote this program on turbo c++ , on my pc. And its takin in the inputs that i'm giving and storing it in a file(i can view the contents in the file s of the BIN file of turbo c++) but when its comes to displaying it on the output screen its only showing this- "name marks roll no do you want to view more records" and when i type y it prints this line again. why isn't it displaying the contents stored in the file s.txt ? and please tell me my error according to turbo c++ and not on the basis of the sololearn platform. https://code.sololearn.com/cmpLhp5JB22F/#

9th Jan 2020, 4:46 AM
riya
riya - avatar
1 Answer
0
Try to use getline() function to read the file in string and then cout the string, as here http://www.cplusplus.com/doc/tutorial/files/
9th Jan 2020, 6:21 PM
Ss13
Ss13 - avatar