I need to load a word from a file. I've been using ifstream and strings but the problem is that I also need to use it in win32 and strings don't work there enough. Is there any other way to do this without strings and/or ifstream.
- reC
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I need to load a word from a file. I've been using ifstream and strings but the problem is that I also need to use it in win32 and strings don't work there enough. Is there any other way to do this without strings and/or ifstream.
- reC
Why not use strings to read in the data and then convert it to a C style string using the convertor function c_str() ??
e.g.
string aStr;
ifstream aFile;
aFile.open("myfile.txt");
aFile >> aStr;
then use aStr.c_str(); wherever you need a C style string.
BlakJak :]
But if I need to for example set editbox's text I need to have char* to hold text how to convert a string to use it on that.
And I'm using c++ not c
- reC