📅  最后修改于: 2020-09-25 09:32:05             🧑  作者: Mango
fwscanf() 函数在
int fwscanf( FILE* stream, const wchar_t* format, ... );
fwscanf() 函数从文件流流中读取数据,并将值存储到各个变量中。
#include
#include
#include
#include
int main()
{
FILE *fp = fopen("example.txt","w+");
wchar_t str[10], ch;
setlocale(LC_ALL, "en_US.UTF-8");
fwprintf(fp, L"%ls %lc", L"Summation", L'\u2211');
fwprintf(fp, L"%ls %lc", L"Integral", L'\u222b');
rewind(fp);
while((fwscanf(fp, L"%ls %lc", str, &ch))!=EOF)
{
wprintf(L"%lc is %ls\n", ch, str);
}
fclose(fp);
return 0;
}
∑ is Summation
∫ is Integral