printf sprintf %s %S

printf 的%s,用來打印ANSI字符串
printf的%S,用來打印UNICODE字符串

#include <Windows.h>
#include <stdio.h>
#include <tchar.h>
#include <iostream>
using namespace std;

int main()
{
    printf("my name is %S",L"XYZ");
    return 0;
}

這裏寫圖片描述
改成printf(“my name is %S”,”XYZ”)
這裏寫圖片描述
改成printf(“my name is %s”,L”XYZ”)
這裏寫圖片描述
sprintf的%s同理

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章