hi every one, I am making KBC game in C++. To store questions and its options in a file, I am unable to write successfully the character string of question in the file due to spaces between question. So,can anyone tell me how to write a character string having spaces to a file and how it can be read from the file in a character array?
Thanx for your help, it worked. But one problem is that i was using a while loop with cin as a condition. this loop keeps on taking input from user unless user enters '^Z'. now using cin.getline, the loop is not terminating by entering '^Z'. What should i do with this loop?
here is the fragmant of that loop
cout<<"enter the question";
I don't know much about c++. but I am excite to get more knowledge of c++. It's very useful language. It uses many where. All the coding is very easy to implement so I am thankful to share the a part of coding for KBC game.
Yes u are right. But i thought it seemed uncomfortable for the person entering data to select yes or no every time he/she enters a question. Butr now I have done it with do-while as you recommended. Thanks a lot for your help! My problem is solved!