- 博客(3)
- 收藏
- 关注
原创 第三次课
#include<stdio.h> #include int main(int argc, const char* argv[]) { Student yuechu; yuechu.init(); yuechu.set_name(“yue chu”); yuechu.print(); ////yuechu.clean(); ////int* p = new int; //Student *p = new Student;//指针永远是8个字节 //p->init(); //p->se
2020-06-02 15:30:03 236
原创 第二节课,关于开辟空间,和类对象简单
#include<stdio.h> #include //声明一个变量,其中内容是自己定义的 struct Person { public: char job; char name[20]; char numb; //封装,允许在struct内部声明定义函数,成员函数,这些函数叫做成员函数,他们为了这个结构体类型变量, //用来修改这个结构体类型的成员变量 //类,,,,,某种类型 //对象…某个类型的变量 private: void set_name(Person& stu, cons
2020-06-02 10:50:53 134 1
原创 c++,第一节课
上课老师写的,我瞎跟着一起抄的 #include<stdio.h> #include void swap(int *a, int *b)//用了指针的方法 { int t; t = *a; *a = b; b = t; } void swap1(int& a, int& b)//引用的方法 { int t; t = a; a = b; b = t; } //声明一个变量,其中内容是自己定义的 struct Person { char job[20]; char name[20];
2020-05-31 15:57:10 129
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人