![](https://img-blog.csdnimg.cn/20201014180756919.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
C++
业余计算机
这个作者很懒,什么都没留下…
展开
-
c++找出未交电子作业的人员名单
就是用循环查找的,暴力查找 话不多说,上代码 #include<iostream> using namespace std; #include<string> #include<io.h> #include<vector> #include<fstream> //string filePath = "D:\\先放在这里安装包\\计科11905班健康码41人"; //string qian = "D:\\VS创建的项目\\项目练手\\excel对比原创 2021-12-13 18:34:34 · 975 阅读 · 0 评论 -
构造函数
构造函数的调用 括号法: Student p1(10); 显示法: Student p2(10)=Student(10); 隐式转换法 :Student p3=10; 注意: 调用无参构造函数时,不能加括号,加了编译器会认为时一个函数声明 不能利用拷贝构造函数初始化匿名对象,编译器会认为是对象的声明 Student (p4) = Student p4; ...原创 2020-10-05 13:24:55 · 267 阅读 · 0 评论 -
函数的分文件编写
函数的分文件编写 一般4个步骤: 创建后缀名为.h的头文件 创建后缀名为.cpp的源文件 在头文件中写函数的声明 在源文件中写函数的定义 示例: //swap.h 头文件 #pragma once void swap(int& a, int& b) //swap.cpp 源文件中创建后编写 //#include"swap.h" void swap(int& a, int& b) (引用作为函数参数) { int temp = a; a = b;原创 2020-10-04 19:37:27 · 147 阅读 · 0 评论