- 注册
- 2003-11-11
- 消息
- 1,222
- 荣誉分数
- 92
- 声望点数
- 208
fwprintf 是一个很简单的function, man fwprintf得知需#include <stdio.h> & <wchar.h>,但编译时老说 fwprintf 未定义,是何原因?
test.cpp
#include <stdio.h>
#include <wchar.h>
int main(void)
{
int rc, i;
wchar_t wcstr[] = {L"%c"};
for(rc = 0, i = 0; wcstr; i++)
rc += fwprintf(stdout, wcstr, wcstr);
fprintf(stdout, "\n");
return rc;
}
Error msg:
`fwprintf' undeclared (first use this function)
(Each undeclared identifier is reported only once for each function it appears in.)
test.cpp
#include <stdio.h>
#include <wchar.h>
int main(void)
{
int rc, i;
wchar_t wcstr[] = {L"%c"};
for(rc = 0, i = 0; wcstr; i++)
rc += fwprintf(stdout, wcstr, wcstr);
fprintf(stdout, "\n");
return rc;
}
Error msg:
`fwprintf' undeclared (first use this function)
(Each undeclared identifier is reported only once for each function it appears in.)