使用宽字符

#include stdio.h#include wchar.hint main(void){wchar_t value = L\\u00f6;wchar_t wch = LI;

编程学习网为您整理以下代码实例,主要实现:使用宽字符,希望可以帮到各位朋友。

#include <stdio.h>
#include <wchar.h>

int main(voID){
    wchar_t value = L'\u00f6';
    wchar_t wch = L'I';
    wchar_t w_arr[20] = L"am wIDe!";
    printf("%lc %ls  %lc\n", wch, w_arr, value);
    puts("Enter your grade:");

    scanf("%lc", &wch);
    puts("Enter your first name:");
    scanf("%ls",w_arr);
    printf("%lc %ls\n", wch, w_arr);
    wchar_t * pw = L"Points to a wIDe-character string";

    int doZen = 12;
    wprintf(L"Item %d: %ls\n", doZen, pw);
    return 0;
}

本文标题为:使用宽字符

基础教程推荐