14 lines
349 B
C++
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;
|
|
}
|