#include
#include
#include
int main(void)
{
wchar_t fmt_cmp[128] = { L' ' };
wchar_t prefix[32] = L"-";
wchar_t suffix[32] = L"";
wchar_t number[128] = L"123.456,78";
char output_cmp[256];
wcscpy( fmt_cmp, prefix );
wcscat( fmt_cmp, number );
wcscat( fmt_cmp, suffix );
if ( -1 != wcstombs( output_cmp, fmt_cmp, 256 ))
{
printf( "Résultat: %sn", output_cmp );
}
return 0;
}
Convertir un ou plusieurs caractères en des caractères ‘multibyte’
Author: user
#include
#include
#include
int main(void)
{
wchar_t fmt_cmp[128] = { L' ' };
wchar_t prefix[32] = L"-";
wchar_t suffix[32] = L"";
wchar_t number[128] = L"123.456,78";
char output_cmp[256];
wcscpy( fmt_cmp, prefix );
wcscat( fmt_cmp, number );
wcscat( fmt_cmp, suffix );
if ( -1 != wcstombs( output_cmp, fmt_cmp, 256 ))
{
printf( "Résultat: %sn", output_cmp );
}
return 0;
}