上一页 1 ··· 38 39 40 41 42 43 44 45 46 ··· 48 下一页
摘要: 字符串类.cpp #pragma warning(disable:4996) #define _CRT_SECURE_NO_WARNINGS 1 //2022年10月14日21:22:09 #include<iostream> using namespace std; #include "MyStr 阅读全文
posted @ 2022-10-15 18:56 CodeMagicianT 阅读(47) 评论(0) 推荐(0)
摘要: 程序1: #pragma warning(disable:4996) #include <iostream> using namespace std; class Maker { public: Maker() { a = 0; } void SetA(int val) { a = val; } / 阅读全文
posted @ 2022-10-15 18:56 CodeMagicianT 阅读(30) 评论(0) 推荐(0)
摘要: 1.类里有重载函数调用符号的类实例化的对象也叫仿函数 2.仿函数的作用:1.方便代码维护 2.方便有权限的调用函数。3.作为算法的策略 程序1: #pragma warning(disable:4996) #include <iostream> using namespace std; class 阅读全文
posted @ 2022-10-14 20:13 CodeMagicianT 阅读(34) 评论(0) 推荐(0)
摘要: 1.智能指针类是管理另一个类的对象的释放 class Maker { public: Maker() { cout << "无参构造" << endl; } void printMaker() { cout << "hello Maker" << endl; } ~Maker() { cout << 阅读全文
posted @ 2022-10-14 18:50 CodeMagicianT 阅读(41) 评论(0) 推荐(0)
摘要: 程序1: 11数组下标重载.cpp #pragma warning(disable:4996) #include <iostream> using namespace std; #include "MyArray.h" void test() { MyArray arr; for( int i = 阅读全文
posted @ 2022-10-13 20:40 CodeMagicianT 阅读(32) 评论(0) 推荐(0)
摘要: 有的时候在VS中遇到的error C1083: 无法打开**: “ * .*”: No such file or directory的错误,这里总结了我遇到过的情况: 错误 C1083 无法打开包括文件: “MyArray.h”: No such file or directory 1.第一种情况: 阅读全文
posted @ 2022-10-13 19:58 CodeMagicianT 阅读(813) 评论(0) 推荐(0)
摘要: 1.前置和后置(++/--)运算符重载 重载的++和--运算符有点让人不知所措,因为我们总是希望能根据它们出现在所作用对象的前面还是后面来调用不同的函数。解决办法很简单,例如当编译器看到++a(前置++),它就调用operator++(a),当编译器看到a++(后置++),它就会去调用operato 阅读全文
posted @ 2022-10-13 14:32 CodeMagicianT 阅读(66) 评论(0) 推荐(0)
摘要: 程序1: #pragma warning(disable:4996) //2022年10月12日21:26:43 #include <iostream> using namespace std; class Maker { public: Maker() { id = 0; age = 0; } M 阅读全文
posted @ 2022-10-12 21:38 CodeMagicianT 阅读(38) 评论(0) 推荐(0)
摘要: 1.赋值(=)运算符重载 赋值符常常初学者的混淆。这是毫无疑问的,因为’=’在编程中是最基本的运算符,可以进行赋值操作,也能引起拷贝构造函数的调用。 class Person{ friend ostream& operator<<(ostream& os,const Person& person){ 阅读全文
posted @ 2022-10-12 21:04 CodeMagicianT 阅读(64) 评论(0) 推荐(0)
摘要: 1.视频内容 程序1: #pragma warning(disable:4996) #include <iostream> using namespace std; void test() { int a; cin >> a; cout << a << endl; } class Maker { f 阅读全文
posted @ 2022-10-05 22:23 CodeMagicianT 阅读(43) 评论(0) 推荐(0)
上一页 1 ··· 38 39 40 41 42 43 44 45 46 ··· 48 下一页