- 博客(3)
- 收藏
- 关注
原创 第三次课
#include<stdio.h>#includeint 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 229
原创 第二节课,关于开辟空间,和类对象简单
#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 126 1
原创 c++,第一节课
上课老师写的,我瞎跟着一起抄的#include<stdio.h>#includevoid 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 117
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人