1 2 3 4 5 6 7 8 9
#include <stdlib.h> #include <wchar.h> int wctomb(char *s, wchar_t wc) { if (s == NULL) return 0; return wcrtomb(s, wc, 0); }