fgetws

A812DLG1 2014-10-23 11:58:40
前辈:为什我把“fgetws”这个写在程序里,然后编译会出现错误提示信息?我用的编译器是C-free3.5.程序如下
错误信息:“implicit declaration of function int fgetws{....} ”
#include <stdio.h>
#include <wchar.h>
int main( )
{
wchar_t text[100];
wchar_t substring[40];
printf("\nEnter the string to be searched"
"(less than 100 characters):\n");
fgetws(text ,100,stdin);

printf("\nEnter the string to be searched"
"(less than 40 characters):\n");
fgetws(substring ,40,stdin);
//overwrite the newline character in each string

return 0;
}

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

int main( )
{
wchar_t text[100];
wchar_t substring[40];
printf("\nEnter the string to be searched"
"(less than 100 characters):\n");
fgetws(text ,100,stdin);

printf("\nEnter the string to be searched"
"(less than 40 characters):\n");
fgetws(substring ,40,stdin);
//overwrite the newline character in each string

return 0;
}
...全文
242 7 打赏 收藏 转发到动态 举报
写回复
用AI写文章
7 条回复
切换为时间正序
请发表友善的回复…
发表回复
赵4老师 2014-10-25
  • 打赏
  • 举报
回复
引用 6 楼 A812DLG1 的回复:
赵老师:你说的VS也是编译器的一种吗?如果是敢问赵老师网上哪里有这种编译器?
http://bbs.csdn.net/topics/390812579
A812DLG1 2014-10-25
  • 打赏
  • 举报
回复
赵老师:你说的VS也是编译器的一种吗?如果是敢问赵老师网上哪里有这种编译器?
A812DLG1 2014-10-24
  • 打赏
  • 举报
回复
赵老师:你的三个方法我都试过了,还是报错。是不是程序有问题 啊?我是按书上给的程序练习的。“fgetws”它是函数吗?
赵4老师 2014-10-24
  • 打赏
  • 举报
回复
我VC6没错。 建议重装VS
赵4老师 2014-10-23
  • 打赏
  • 举报
回复
再不行,将所有printf("...改为wprintf(L"... ?
赵4老师 2014-10-23
  • 打赏
  • 举报
回复
或者将#include <wchar.h>挪到第一行?
赵4老师 2014-10-23
  • 打赏
  • 举报
回复
删掉#include <wchar.h>试试看。

69,371

社区成员

发帖
与我相关
我的任务
社区描述
C语言相关问题讨论
社区管理员
  • C语言
  • 花神庙码农
  • 架构师李肯
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧