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?
Regards....
Sw8Lala
0
Newbie Poster
Recommended Answers
Jump to PostI think you need getline()
Jump to Postgetline() from iostream will do the reading and you should use ofstream to do the writing. Give this a shot. If it doesn't work, post a < 10 line demonstration of the problem.
Dave
All 6 Replies
iamthwee
daviddoria
334
Posting Virtuoso
Featured Poster
Sw8Lala
0
Newbie Poster
iamthwee
jacks2028
0
Newbie Poster
Sw8Lala
0
Newbie Poster
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.