09 2021 档案

摘要:前言 先上结论: ·成对使用 new 和 delete 时要采用相同形式 1.在 new 表达式中使用 [], 那么在 delete 中也要使用 [] 2.在 new 表达式中没有使用 [], 那么在 delete 中不要使用 [] 例如: string* a1 = new string; stri 阅读全文
posted @ 2021-09-10 15:46 想想就很离谱 阅读(204) 评论(0) 推荐(0)
摘要:前言 在调试程序的时候会使用一些打印函数进行辅助调试,在期间遇到一些平时没注意的事儿。 代码演示 #include <iostream> #include <stdio.h> using namespace std; int main(int arg, char** argv) { int n = 阅读全文
posted @ 2021-09-03 17:59 想想就很离谱 阅读(119) 评论(0) 推荐(0)
摘要:在Linux下简单编译程序 源码main.cpp #include <iostream> using namespace std; int main(int arg, char** argv) { cout << "Cpp.c" << endl; return 0; } 1.直接使用g++编译 g+ 阅读全文
posted @ 2021-09-03 16:23 想想就很离谱 阅读(832) 评论(0) 推荐(0)