📅  最后修改于: 2020-09-25 09:40:07             🧑  作者: Mango
swscanf() 函数在
int swscanf( const wchar_t* buffer, const wchar_t* format, ... );
swscanf() 函数从缓冲区读取数据,并将值存储到各个变量中。
#include
#include
int main()
{
wchar_t buffer[100] = L"Theta \u03b8";
wchar_t symbol, desc[10];
setlocale(LC_ALL, "en_US.UTF-8");
swscanf(buffer, L"%ls %lc", desc, &symbol);
wprintf(L"%lc is %ls\n", symbol, desc);
return 0;
}
运行该程序时,可能的输出为:
θ is Theta