2021年1月5日

类的成员函数

摘要: 5、小作业: 类的声明和实现大家自己课后用VS2013练习如何添加类吧 #pragma once #include <iostream> #include <string> using namespace std; class CStudent { string name; int age; pub 阅读全文

posted @ 2021-01-05 22:41 SakuraQAQ 阅读(73) 评论(0) 推荐(0)

类的声明

摘要: 6、小作业:自己定义一个学生类,将该类的所有成员变量都声明为私有的,并添加一个共有的成员函数,实现从键盘录入该类对象的学生信息。 #include <iostream> #include <string> using namespace std; class CStudent { string s_ 阅读全文

posted @ 2021-01-05 21:27 SakuraQAQ 阅读(100) 评论(0) 推荐(0)

引用及new和delete的使用

摘要: 8、小作业:完成 get_same_string 函数的功能! #include <iostream> using namespace std; char* get_same_string(char* x,char* y) { int str1 = strlen(x); int str2 = str 阅读全文

posted @ 2021-01-05 15:41 SakuraQAQ 阅读(83) 评论(0) 推荐(0)

导航