上一页 1 2 3 4 5 6 7 8 9 ··· 11 下一页

2016年6月1日

C++11

摘要: 238 down vote accepted Flags (or compiler options) are nothing but ordinary command line arguments passed to the compiler executable. Assuming you are 阅读全文

posted @ 2016-06-01 16:49 shoutcharter 阅读(112) 评论(0) 推荐(0) 编辑

int string convert

摘要: C++ int与string的转化 int本身也要用一串字符表示,前后没有双引号,告诉编译器把它当作一个数解释。缺省 情况下,是当成10进制(dec)来解释,如果想用8进制,16进制,怎么办?加上前缀,告诉编译器按照不同进制去解释。8进制(oct) 前缀加 0,16进制(hex) 前缀加0x或者0X 阅读全文

posted @ 2016-06-01 16:12 shoutcharter 阅读(217) 评论(0) 推荐(0) 编辑

.SO 出现 undefined reference

摘要: 查看本SO文件依赖哪些其他的SO文件: readelf -d ldd undefined reference 涉及的问题是 主程序及静态库不能定位地址 undefined symbol 说的问题是动态库不能定位地址 可能是打开了 -as-needed选项同时顺序又不对导致的。 链接的是够对于GCC用 阅读全文

posted @ 2016-06-01 11:50 shoutcharter 阅读(1045) 评论(0) 推荐(0) 编辑

2016年5月28日

string string.h=cstring=str

摘要: <string.h> <string.h>是C版本的头文件,包含比如strcpy、strcat之类的字符串处理函数。 <cstring> 在C++标准化(1998年)过程中,为了兼容以前,标准化组织将所有这些文件都进行了新的定义,加入到了标准库中,加入后的文件名就新增了一个"c"前缀并且去掉了.h的 阅读全文

posted @ 2016-05-28 14:55 shoutcharter 阅读(134) 评论(0) 推荐(0) 编辑

2016年2月21日

C++Primer charpter1.

摘要: 一、输入输出流 endl:会刷新buffer。刷新之后你才能看到。不手动用endl的话,就只能依靠系统自动刷。程序崩溃的话,你看到的调试信息可能是错误的。 >>: 两个连续的符号 cin>> vin >> vin2; =cin>>vin; cin>>vin2; 二、注释 std::cout << " 阅读全文

posted @ 2016-02-21 21:14 shoutcharter 阅读(132) 评论(0) 推荐(0) 编辑

2015年4月23日

template of class

摘要: class template will call the constructor of its member object before constructor itself...... 阅读全文

posted @ 2015-04-23 21:18 shoutcharter 阅读(95) 评论(0) 推荐(0) 编辑

auto_ptr, which can release the space automatically

摘要: C++的auto_ptr所做的事情,就是动态分配对象以及当对象不再需要时自动执行清理。使用std::auto_ptr,要#include 。[1]中文名自动指针外文名auto_ptr在C++中, auto_ptr是一个类,它用来实现对动态分配对象的自动释放。它的源代码:?12345678910111... 阅读全文

posted @ 2015-04-23 21:16 shoutcharter 阅读(194) 评论(0) 推荐(0) 编辑

2015年4月19日

The initialize list of C++ Class

摘要: 性能问题之外,有些时场合初始化列表是不可或缺的,以下几种情况时必须使用初始化列表常量成员,因为常量只能初始化不能赋值,所以必须放在初始化列表里面Error1(constchar* constmsg) :data(msg){//data = msg; }引用类型,引用必须在定义的时候初始化,并且不能重... 阅读全文

posted @ 2015-04-19 22:05 shoutcharter 阅读(290) 评论(0) 推荐(0) 编辑

Assert

摘要: Assert(false)The system will throw out a exception.使用assert的缺点是,频繁的调用会极大的影响程序的性能,增加额外的开销。在调试结束后,可以通过在包含#include的语句之前插入 #define NDEBUG 来禁用assert调用,示例代码... 阅读全文

posted @ 2015-04-19 18:36 shoutcharter 阅读(121) 评论(0) 推荐(0) 编辑

Array and its point.

摘要: a is the array name.&a is the ponit of 2-D array which contains a[5].the type of &a should be int (*)[5]. oh what is int(*)5............................. 阅读全文

posted @ 2015-04-19 17:07 shoutcharter 阅读(146) 评论(0) 推荐(0) 编辑

上一页 1 2 3 4 5 6 7 8 9 ··· 11 下一页

导航