Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Dark GDK / DarkGdk text file load to String

Author
Message
Szymat
13
Years of Service
User Offline
Joined: 17th Oct 2010
Location:
Posted: 11th Nov 2011 18:03 Edited at: 11th Nov 2011 18:25
Hi!

I want to load text file to string (like options or map) using C++.
Got any ideas?

I solved it, sry, I don't know how to delete this post. (Sorry for spam again).
Zapleaf
14
Years of Service
User Offline
Joined: 16th Oct 2009
Location:
Posted: 11th Nov 2011 18:44
I would like to know how you did this. I am having the same problem.
DeadTomGC
13
Years of Service
User Offline
Joined: 11th Aug 2010
Location: LU
Posted: 23rd Nov 2011 21:46 Edited at: 26th Nov 2011 21:22
Well you probably want to use the fstream header (#include <fstream>
Then you can make an fstream like such


This way it is easy to get numbers separated by spaces


you can also read in lines to character arrays using getline helpful
If you have questions about C++ I would recommend you use msdn to learn about what you need quickly.

Hey! I didn't mean to have that emoticon there!


Login to post a reply

Server time is: 2024-04-26 14:52:14
Your offset time is: 2024-04-26 14:52:14