上一页 1 2 3 4 5 6 7 ··· 12 下一页
摘要: 某些人会考虑用long类型的长度来作为判断的标准,这样不是一个好的答案。我认为比较好的答案是利用虚拟地址的位数:1 int main()2 {3 4 #ifdef __x86_64__5 assert(sizeof(char *) == 8);6 #endif7 return 0;8 }然后见到别人提了一个这样的问题:如果是64位的机器装了32位的系统,你怎么判断呢?A:1. 直接读取/proc/cpuinfo2.更底层点的做法:使用汇编指令cpuid 阅读全文
posted @ 2013-04-24 09:46 strorehouse 阅读(1441) 评论(0) 推荐(0) 编辑
摘要: Asciidoc中的“+”号可以在文中任意位置存在,而成对的"+"号会对其中间的文字起到着色的效果,比如以下的正文:- 熟悉C++语言,熟悉STL并了解对象模型,熟悉c++0x常用特性,了解Qt基础 转化之后会出现这样的显示效果: 这显然不是我们想要的结果,处理的方法很简单,在第一个"+"号之后加个"\"号就行了:- 熟悉C+\+语言,熟悉STL并了解对象模型,熟悉c++0x常用特性,了解Qt基础 阅读全文
posted @ 2013-04-15 21:26 strorehouse 阅读(176) 评论(0) 推荐(0) 编辑
摘要: REFER:SOgit log --author="_Your_Name_Here_" --pretty=tformat: --numstat \| gawk '{ add += $1 ; subs += $2 ; loc += $1 - $2 } END { printf "added lines: %s removed lines : %s total lines: %s\n",add,subs,loc }' - 阅读全文
posted @ 2013-04-14 19:41 strorehouse 阅读(5252) 评论(0) 推荐(0) 编辑
摘要: 阅读全文
posted @ 2013-04-10 11:10 strorehouse 阅读(152) 评论(0) 推荐(0) 编辑
摘要: 阅读全文
posted @ 2013-04-10 10:42 strorehouse 阅读(139) 评论(0) 推荐(0) 编辑
摘要: 阅读全文
posted @ 2013-04-09 21:53 strorehouse 阅读(106) 评论(0) 推荐(0) 编辑
摘要: 阅读全文
posted @ 2013-04-09 21:45 strorehouse 阅读(153) 评论(0) 推荐(0) 编辑
摘要: REFER:SOWhat are these new categories of expressions?The FCD (n3092) has an excellent description:— An lvalue (so called, historically, because lvalues could appear on the left-hand side of an assignment expression) designates a function or an object. [ Example: If E is an expression of pointer type 阅读全文
posted @ 2013-04-08 19:52 strorehouse 阅读(191) 评论(0) 推荐(0) 编辑
摘要: REFER:SOAs of theC++11standard, string-to-number conversion and vice-versa are built in into the standard library. All the following functions are present in<string>(as per paragraph 21.5).string to numericfloat stof(const string& str, size_t *idx = 0);double stod(const string& str, si 阅读全文
posted @ 2013-04-08 19:48 strorehouse 阅读(257) 评论(0) 推荐(0) 编辑
摘要: REFER:SO中文社区见到的答案,不提也罢new/deleteAllocate/release memoryMemory allocated from 'Free Store'Returns a fully typed pointer.new (standard version) never returns a NULL (will throw on failure)Are called with Type-ID (compiler calculates the size)Has a version explicitly to handle arrays.Reallocati 阅读全文
posted @ 2013-04-08 19:33 strorehouse 阅读(161) 评论(0) 推荐(0) 编辑
上一页 1 2 3 4 5 6 7 ··· 12 下一页