Digg StumbleUpon LinkedIn YouTube Flickr Facebook Twitter RSS Reset

Convertir un ou plusieurs caractères en des caractères ‘multibyte’


{filelink=13226}

 
  #include <string.h>
  #include <stdio.h>
  #include <stdlib.h>
 
  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;
  }

No comments yet.

Leave a Comment