C语言 结构体
clara729
修行中的记录
展开
-
C语言/C++结构体疑问小结
1.关于结构体情况一:最简单的结构体定义struct stu{ char no[20]; float score; int rank; };关键字struct表明这是在定义一个结构体,stu是这种数据格式的名称,因此我们可以像使用char、int等创建变量一样使用stu创建stu类型的变量了。情况二:附加"结构体变量”的初始化的结构体定义struct stu{ char no[2...原创 2018-03-21 10:59:36 · 208 阅读 · 0 评论 -
c语言、C++文件读入方法小结
1.C++头文件:#include <iostream> #include <fstream> #include <cassert> #include <string>1.1 逐行读入void readTxt(string file) { ifstream infile; infile.open(file.data()); //...转载 2018-03-21 14:50:44 · 470 阅读 · 0 评论