main.cpp
Code: Select all
char szov[20];
FILE *fh;
fh=_wfopen(L"res\\textx.txt",L"r");
fscanf(fh,"%s",&szov);
fclose(fh);
env->addButton(rect<s32>(10,210,120,230), 0, 101, wide(szov));
In a .h file:
Code: Select all
wchar_t* wide(char *a){
int p;
for(p=0;p<strlen(a);p++){
buf[p]=a[p];
}
buf[p]='\0';
return buf;
}
I tried with the wsprintf thing, but Gcc showed me an error...
If I write:
env->addButton(rect<s32>(10,210,120,230), 0, 101, L"éáőúü");
it works fine, but there is something wrong with my function that returns the string.
What am I missing here?