摘要: 三个类: ofstream: 写文件流 ifstream: 读文件流 fstream: 读写文件流 基本使用 // basic file operations #include <iostream> #include <fstream> using namespace std; int main ( 阅读全文
posted @ 2022-05-25 23:05 suntus 阅读(95) 评论(0) 推荐(0) 编辑
摘要: 一般不要用,用了就要注意一下几点 1. 只能用于 new 申请的对象,不能用于栈上对象 #include <iostream> class A { public: void func() { delete this; } }; int main(int argc, char const *argv[ 阅读全文
posted @ 2022-05-25 23:01 suntus 阅读(75) 评论(0) 推荐(0) 编辑