![](https://img-blog.csdnimg.cn/20201014180756928.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
Linux
xlonlat
这个作者很懒,什么都没留下…
展开
-
warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
include using namespace std;void Test() { int n = 10; (void*)n; }int main() { Test(); return 0; }此时使用g++编译报错: root@ubuntu:/home/Test/Temp# g++ -o app temp.cpp temp.cpp: In fu原创 2017-08-23 16:11:02 · 3069 阅读 · 0 评论 -
error: jump to label ‘xxxxx’ [-fpermissive]
C++中使用goto语句可以跳到指定的函数末端,在使用g++编译时,要注意在goto语句出现之后是不允许出现新申明的变量,所以需要申明变量需要放在所有goto语句之前。(VisutalStudio编译无此问题)。#include void Test(int m){int i = m;if (i > 10) goto res;int j = i原创 2017-08-23 15:20:45 · 10832 阅读 · 0 评论 -
no known conversion for argument 1 from 'class-name' to 'class-name&'
声明复制构造函数,参数需要const修饰,若没有const修饰在VS编译环境下可以通过,但是Linux下使用g++编译,则会报错。templateclass SmartPtr{public:TYPE* m_pData;public:SmartPtr(){m_pData = NULL;}SmartPtr(const SmartPtr &原创 2017-08-30 15:52:20 · 6677 阅读 · 0 评论