From 10c299db68611aa5a95656b341dbc85814fede26 Mon Sep 17 00:00:00 2001 From: ZZH <1462207500@qq.com> Date: Tue, 18 Jul 2023 06:36:37 +0000 Subject: [PATCH] =?UTF-8?q?=E8=83=BD=E5=AF=BC=E8=87=B4=E8=8E=AB=E5=90=8D?= =?UTF-8?q?=E5=85=B6=E5=A6=99=E6=8A=A5=E9=94=99=E7=9A=84=E5=A4=B4=E6=96=87?= =?UTF-8?q?=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: ZZH <1462207500@qq.com> --- C++/stuipd_header.h | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 C++/stuipd_header.h diff --git a/C++/stuipd_header.h b/C++/stuipd_header.h new file mode 100644 index 0000000..217b959 --- /dev/null +++ b/C++/stuipd_header.h @@ -0,0 +1,16 @@ +//在头文件里展开命名空间, 将导致源文件内出现莫名其妙的命名冲突 +using namespace std; +//在头文件里定义变量, 将导致源文件内出现重复定义 +int var1; + +class NewClassName +{ +private: + +protected: + +public: +NewClassName() {} +~NewClassName() {} +//class定义最后缺少分号, 这个错误将导致报错定位在c文件里而非头文件里 +} \ No newline at end of file -- Gitee