|
-
March 24th, 2010, 03:20 AM
#1
Converting wchar_t* to char*
Hello fellas,
I have encountered a problem during the converting process.
Here below is my function to convert wchar_t * to char*
void wtoc(char* Dest,const wchar_t *Source)
{
int i = 0;
while(Source[i] != '\0')
{
Dest[i] = (char)Source[i];
++i;
}
}
it compiles succesfully however on linking phase, it gives out an error
undefined reference to `mynamespace::myfunc::wtoc(char*, wchar_t const*)'
and it is really confusing because I don't have a function with a prototype like that. my prototype is
void wtoc(char* Dest,const wchar_t *Source)
so what is wrong with me in here? And also can you suggest any alternative ways to convert wchar_t to char
Thanx in advance.
DK
Tags for this Thread
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|