Real quick question...
-
I know it's stupid :-O but I'm new to UNICODE ... So. In my code I want to call
inet_addr
which takesconst char*
as parameter, but my string which I want to pass iswchar_t
. How do I squeeze it into that func? :confused: This is what I get from compiler:error C2664: 'inet_addr' : cannot convert parameter 1 from 'const wchar_t *' to 'const char *'
Will it even be able to work with UNICODE string??? MSDN doesn't say a word about UNICODE for this func. I do have _UNICODE in my project defined and everything. Thanks a lot. -
I know it's stupid :-O but I'm new to UNICODE ... So. In my code I want to call
inet_addr
which takesconst char*
as parameter, but my string which I want to pass iswchar_t
. How do I squeeze it into that func? :confused: This is what I get from compiler:error C2664: 'inet_addr' : cannot convert parameter 1 from 'const wchar_t *' to 'const char *'
Will it even be able to work with UNICODE string??? MSDN doesn't say a word about UNICODE for this func. I do have _UNICODE in my project defined and everything. Thanks a lot. -
I know it's stupid :-O but I'm new to UNICODE ... So. In my code I want to call
inet_addr
which takesconst char*
as parameter, but my string which I want to pass iswchar_t
. How do I squeeze it into that func? :confused: This is what I get from compiler:error C2664: 'inet_addr' : cannot convert parameter 1 from 'const wchar_t *' to 'const char *'
Will it even be able to work with UNICODE string??? MSDN doesn't say a word about UNICODE for this func. I do have _UNICODE in my project defined and everything. Thanks a lot.Use the
WideCharToMultiByte()
API. It's documented in MSDN. Set thecbMultiByte
parameter to 0 to determine the length of the target (ASCII) buffer. Then allocate achar
buffer and call the API again to do the actual conversion. If a train station is where the train stops, what's a workstation...?