|
![]() |
Overclock.net - Overclocking.net > Software, Programming and Coding > Coding and Programming > Application Programming | |
C++ CString Convert to const char
|
||
![]() |
|
|
LinkBack | Thread Tools |
|
|
#1 (permalink) | |||||||||||||
|
HULK SMASH!!!
![]() |
Okay problem at the moment is as such:
__________________Code:
CString exporttext("something");
CString exporttext2("somethingelse");
ofstream font("font.txt");
ofstream background("backcolor.txt");
font.write(exporttext, exporttext.GetLength());
background.write(exporttext2, exporttext2.GetLength());
f:\visual studio 2005\projects\tstest3\tstest3\tstest3dlg.cpp(384) : error C2664: 'std::basic_ostream<_Elem,_Traits>::write' : cannot convert parameter 1 from 'CString' to 'const char *' So how do I convert CString to const char * I have seen lots of ways to get to LPCTSTR but that doesn't work either.
|
|||||||||||||
|
|
|
|
#2 (permalink) | |||||||||||||
|
Windows Wrangler
|
Hmm, I'm not really big in any language but maybe:
Code:
string whatyourcompilerwantstobeaconstant = "this is the string with information you're trying to export";
const string thestringisnowconstant = whatyourcompilerwantstobeaconstant;
fout<<thestringisnowconstant;
__________________
Je parle un peu le français, mais je préfère parler l'anglais. Parlez-vous le français aussi? For you English speakers: ">" - greater than; "<" - less than "there" - Hey, look over there. "their" - I love their Mustang. "they're" - They're so lucky!
|
|||||||||||||
|
|
![]() |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
|
|