二十五岁时我们都一样愚蠢、多愁善感,喜欢故弄玄虚,可如果不那样的话,五十岁时也就不会如此明智。
标题:C库函数 - wcstombs()
C库函数 - wcstombs()
#include <stdio.h> #include <stdlib.h> #define BUFFER_SIZE 50 int main () { size_t ret; char *MB = (char *)malloc( BUFFER_SIZE ); wchar_t *WC = L"http://www.codingdict.com"; /* converting wide-character string */ ret = wcstombs(MB, WC, BUFFER_SIZE); printf("Characters converted = %u\n", ret); printf("Multibyte character = %s\n\n", MB); return(0); }