对error C2079: 'stu' uses undefined struct 'Students'的解释
以下是错误程序源代码举例(其实是我自己在学习过程中出现的错误):
#include <stdio.h>
struct Date
{int year;int month;
};
struct Student
{char sno[11];char name[10];int Gshu;int Ccheng;int Yyu;float Average;Date birthday;
};
int main()
{struct Students stu;printf("输入学号:");gets(stu.sno);printf("输入姓名:");gets(stu.name);printf("高数成绩:");scanf("%d",&stu.Gshu);printf("C程成绩:");scanf("%d",&stu.Ccheng);printf("英语成绩:");scanf("%d",&stu.Yyu);stu.Average=(stu.Gshu+stu.Ccheng+stu.Yyu)/3.0;printf("输入出生年月");scanf("%d%d",&stu.birthday.year,&stu.birthday.month);printf("学号 姓名 高数 C程 英语 平均成绩 出生年月\n");printf(" %11s",stu.sno);printf(" %6s",stu.name);printf(" %3d %3d %3d %4.1f",stu.Gshu,stu.Ccheng,stu.Yyu);printf(" %d年%d月\n",stu.birthday.year,stu.birthday.month);return 0;
}
运行错误如下:
这个地方的错误是将上文中的Student误写为Students,于是出现了未定义的错误,改正方式只要将Students改为Student就可以解决。但是如果不是因为笔误,而是正确的写出了Student,但是仍然为错误的话,解决方法是检查上文中有没有对Student进行定义(struct),通过对Student定义即在前文(主函数外)添加:struct Student,就可以解决。
对error C2079: 'stu' uses undefined struct 'Students'的解释相关推荐
- PCL学习(3)——kdtree搜索(error C2079: “pcl::KdTreeFLANN::param_radius_)
简介: 算法原理 1.建立kdtree 主要有两步操作:选择合适的分割维度,选择中值节点作为分割节点: 分割维度的选择遵循的原则是,选择范围最大的纬度,也即是方差最大的纬度作为分割维度: 分割节点的选 ...
- left of 'name' specifies undefined struct/union '$S1'
在链表创建和输出中遇到的问题 #include <stdio.h> #include <stdlib.h> struct student { char name[20]; ...
- 【异常】Error: ERROR 1012 (42M03): Table undefined. (state=42M03,code=1012)
[异常]Error: ERROR 1012 (42M03): Table undefined. (state=42M03,code=1012) 参考文章: (1)[异常]Error: ERROR 10 ...
- Error:express-session deprecated undefined resave option; provide resave option app.js:17:10
Error:express-session deprecated undefined resave option; provide resave option app.js:17:10 报错如下 解决 ...
- error: identifier “AT_CHECK“ is undefined
错误原因 在使用pytorch编译maskrcnn-benchmark的时候报,如下错误 idia/.local/lib/python3.6/site-packages/torch/include/T ...
- ubuntu 18.04 git clone 出错symbol lookup error: libhogweed.so.4: undefined symbol: __gmpn_cnd_add_n
在ubuntu 18.04 使用命令 git clone 然后出错了 symbol lookup error: libhogweed.so.4: undefined symbol: __gmpn_cn ...
- error C2079: CButtonST::m_ToolTip 使用未定义的 class CToolTipCtrl
error C2079: CButtonST::m_ToolTip 使用未定义的 class CToolTipCtrl CButtonst使用中出的错误,头文件加载顺序出错,解决方法: #ifndef ...
- LaText Error:Environment aligned undefined.
目录 问题描述: 问题解决: 问题描述: 使用在线的Overleaf编译论文,公式部分报错如下. 问题解决: 出现这种"Environment xxx undefined"的问题, ...
- detectron2编译错误: error: identifier “single_box_iou_rotated“ is undefined
Python:3.10 CUDA:11.3 detectron2:0.6 torch:1.11.0+cu113 git clone detectron2的源码之后执行python setup.py b ...
最新文章
- java error could_Java.lang.Error: Properties init: Could not determine current working directory.
- python导入json模块_Python调用json模块代码实例
- android 页卡切换实现,TabLayout+ViewPager实现选项卡切换效果
- boost::random::const_mod相关的测试程序
- 游戏编程入门之绘制动画的精灵(爆炸特效)
- python计算公式分母有0_你知道Python中的浮点除法和积分除法吗,python,float,整除,都...
- 为什么要保持软件包依赖项自由循环的五个原因
- 计算机盘符无法重命名,win8磁盘分区无法重命名怎么办
- html jade文件,Jade模板
- C语言自学笔记(20)
- jQuery控制video视频(快进,回退,倍速播放等)
- 如何将网页保存为pdf
- A* operator/(A*, A*)‘ must have an argument of class or enumerated type
- 修改Google浏览器默认打开是金山毒霸网址
- 站在Stay老司机肩膀上分析Retrofit
- 流媒体视频播放代码总结。
- 光纤收发器上的FEF功能有什么用?
- Java MultipartFile实现文件上传并为图片加上水印(二)
- 数据的存储,大端存储和小端小端存储
- 菜鸟网络面试——123面
热门文章
- 2021-2027全球与中国呼吸道病原菌核酸检测试剂盒市场现状及未来发展趋势
- 关于“华为”的大数据分析
- java null什么意思_浅谈java中null是什么,以及使用中要注意的事项
- 【Simulink教程案例13】基于QPSK的位同步simulink建模与仿真分析
- win10电脑内存莫名过高问题解决
- data analysis (summary next step)
- 手机访问电脑文件_彻底解决手机-电脑互传大文件的难题 电脑-手机快捷互联互通...
- 避免使用虚函数作为库的接口
- 学习openvz虚拟机
- 《人性的弱点》总结之一 --- 人际交往的基本技巧