Code: Select all
font->draw(L"Bloodyness",rect<s32>(5,80,300,50),SColor(255,255,255,255));
font->draw(integer,rect<s32>(5,80,300,50),SColor(255,255,255,255));
Code: Select all
LCode: Select all
font->draw(L"Bloodyness",rect<s32>(5,80,300,50),SColor(255,255,255,255));
font->draw(integer,rect<s32>(5,80,300,50),SColor(255,255,255,255));
Code: Select all
LCode: Select all
#include <stdio.h>
..
wchar_t myString[64];
swprintf(myString, 64, L"Bloodyness: %i and something else: %i", integer, anotherInteger);
font->draw(myString, rect<s32>(5,80,300,50),SColor(255,255,255,255));
Code: Select all
char* wcharToChar (const wchar_t* cadena) {
size_t alloc_len = wcslen(cadena) + 1;
char* retorno = new char[alloc_len];
size_t result = wcstombs (retorno, cadena, alloc_len);
return retorno;
}
wchar_t* charToWchar (const char* cadena) {
size_t alloc_len = strlen(cadena) + 1;
wchar_t* retorno = new wchar_t[alloc_len];
size_t result = mbstowcs (retorno, cadena, alloc_len);
return retorno;
}
Code: Select all
PointerNeeded* pointer = function(...);
//use here the pointer
delete[] pointer
L species that it's a wide character string (wchar_t, rather than char).And by the way, what is the L for?