数据圈 2015-08-18 09:04 采纳率: 0%
浏览 5388

这个警告是怎么回事?我把头文件加入进来了,源代码如下

c(14): warning C4013: “gets”未定义;假设外部返回 int  

#define _CRT_SECURE_NO_WARNINGS
#include
#include
#include
void main()
{
void swap(char *, char *);//函数声明
char str1[20], str2[20], str3[20];//定义三个字符串数组
printf("input three line:\n");
gets(str1);
gets(str2);
gets(str3);//字符串初始化

if (strcmp(str1, str2)>0)   swap(str1, str2);//如果str1大,交换
if (strcmp(str1, str3)>0)   swap(str1, str3);
if (strcmp(str2, str3)>0)   swap(str2, str3);
printf("Now,the order is:\n");
printf("%s\n%s\n%s\n", str1, str2, str3);
system("pause");

}
void swap(char *p1, char *p2)
{
char p[20];
strcpy(p, p1); strcpy(p1, p2); strcpy(p2, p);//字符串排序函数
}

  • 写回答

5条回答 默认 最新

  • 91program 博客专家认证 2015-08-18 09:11
    关注

    可能是编译器的原因,这些都是标准C的函数

    评论

报告相同问题?

悬赏问题

  • ¥15 微信公众号自制会员卡没有收款渠道啊
  • ¥15 stable diffusion
  • ¥100 Jenkins自动化部署—悬赏100元
  • ¥15 关于#python#的问题:求帮写python代码
  • ¥20 MATLAB画图图形出现上下震荡的线条
  • ¥15 关于#windows#的问题:怎么用WIN 11系统的电脑 克隆WIN NT3.51-4.0系统的硬盘
  • ¥15 perl MISA分析p3_in脚本出错
  • ¥15 k8s部署jupyterlab,jupyterlab保存不了文件
  • ¥15 ubuntu虚拟机打包apk错误
  • ¥199 rust编程架构设计的方案 有偿