Hello there, I have here a problem with the function open(). Since its first parameter asks for a char*, how would i convert wchar_t* to char* if my program asks for a wchar_t* as its path rather than char*?
jaepi
22
Practically a Master Poster
Recommended Answers
Jump to PostI like to use wcstombs() because it is pretty easy to use. There are, however, other more powerful fuctions that may be better used for some languages such as Chinese.
Jump to Postan alternative is to use the ctype<> facet. the advantages are a. also works with c++ strings b. locales other than the default locale are supported (behaviour is unaffected by the LC_CTYPE category of the current c locale). 3. will not fail if a wide-character code encountered does not correspond …
All 7 Replies
Ancient Dragon
5,243
Achieved Level 70
Team Colleague
Featured Poster
jaepi
22
Practically a Master Poster
vijayan121
1,152
Posting Virtuoso
WolfPack
commented:
I didn't know this. Thank you.
+7
jaepi
22
Practically a Master Poster
utruppo
0
Newbie Poster
epolgar
0
Newbie Poster
epolgar
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.