MTSL/main.cpp
youspectrum d797c2f62e 初始提交:String 与 Link
string =重载的返回的this
2022-09-25 22:30:57 +08:00

14 lines
349 B
C++

#include <iostream>
#include "h/LinkList.h"
#include "h/String.h"
int main() {
String string("123456");
// 赋值 重载函数 返回了 *this
// 这使得以 目的值具有 对象的this
// 更改的值 不在函数内 而是申请的堆中
String str = string;
std::cout << str.get_c_str() << std::endl;
return 0;
}