加载中
C,C++开源项目中的100个Bugs

俄罗斯OOO Program Verification Systems公司用自己的静态源码分析产品PVS-Studio对一些知名的C/C++开源项目,诸如Apache Http Server、Chromium、Clang、CMake、MySQL等的源码进行了分析,找...

让 Gnu Global 识别C++头文件

使用 Gnu Global 来索引C++代码时,会发现定义在 .h文件中的class不能被索引,下面找到一个解决方法: TUESDAY, JUNE 14, 2011 GNU Global does not recognize C++ classes By default, GNU...

2013/01/18 13:44
503
Pointers and Constants

常量指针与指针常量,非常容易混淆,在网络和各种教程上看了各式各样的对比的记忆技巧,当时可以区分,但过段时间,又搞不清楚了。看到C++作者的一句描述后,“啪”一下,就记住了,也许这辈...

C语言宏定义中#用法

宏中"#"和"##"的用法 一、一般用法 我们使用#把宏参数变为一个字符串,用##把两个宏参数贴合在一起. 用法: #i nclude<cstdio> #i nclude<climits> using namespace std; #define STR(s) #s ...

C语言变量类型

C语言变量类型 auto static external static external register auto 局部变量 auto 变量是用堆栈(stack)方式占用储存器空间,因此,当执行此区段是,系统会立即为这个变量分配存储器空间,而...

2011/03/11 13:18
588
-16 | 12 等于多少

今天同事问到一个问题 -16 | 12 等于多少? 从教材中知道,二进制数的第一位是符号位,正数为0,负数为1,再根据取反的定义可得到如下算式(假设整形是占四位): (-64)10 | (12)10 = (...

2011/01/17 18:03
479
C语言中auto,register,static,const,volatile的区别

1)auto 这个关键字用于声明变量的生存期为自动,即将不在任何类、结构、枚举、联合和函数中定义的变量视为全局变量,而在函数中定义的变量视为局部变量。这个关键字不怎么多写,因为所有的变...

2011/01/04 10:52
408
C语言高级:位域

什么是位域: 有些信息在存储时,并不需要占用一个完整的字节, 而只需占几个或一个二进制位。例如在存放一个开关量时,只有0和1 两种状态, 用一位二进位即可。为了节省存储空间,并使处理简...

2010/12/06 10:54
856
Makefile 中四种变量赋值方式的区别

Ask: What is the difference between :  VARIABLE = value  VARIABLE ?= value  VARIABLE := value  VARIABLE += value I have read the section in GNU Make's manual, but it still ...

2010/11/05 10:53
2.2K
ANSI的Escape序列屏幕控制码

一般人不知道的东西:来自 城市猎人 实为printf 函数的拓展应用 可设置字背景颜色;字体颜色m字符串 int ESC =27; ptintf("%c[参数",ESC); //cusor_ctrl.h #ifndef __CUSOR_CTRL_H_ #define ...

2010/03/09 09:30
1.6K
编译带其它库文件的C程序

问题:今天照前一篇文章做一个小的练习的时候,发现一个错误,好像是找不到sin这个函数,大家可以指点一下么? 源码: #include #include int main(void) { double pi = 3.1416; ...

C++ warning: control reaches end of non-void function

C++ warning: control reaches end of non-void function REASONS: this warning indicate that you forgot the return statement in a non-void function....

2009/08/23 21:47
948
My first c++ class : Tree

A simple c++ class, Contain three file: /* * Tree.h * * Created on: Aug 23, 2009 * Author: sai */ #ifndef TREE_H_ #define TREE_H_ #include using namespace std; c...

c++ Error : non-member function cannot have cv-qualifier

When I building file: ../src/Tree.h, I got this error: ERROR:../src/Tree.h:22: error: non-member function ‘std::ostream& operator<<(std::ostream&, const Tree&)’ cannot have cv...

2009/08/23 20:11
2.3K
About keyword const

const Saying const as part of variable's difinition promises that we are not going to change the value of the variable at the rest of its lifetime. We say that a variable is con...

2009/08/19 22:20
119
Usage of std::endl

Writing the value of std::endl to output stream have two function: First: Ends the line of output. Second: Flushes the buffer, which forces the system to write to the output str...

2009/08/19 21:15
80
Three events that cause the system to flush the buffer

First, the buffer might be full, in which case the library will flush it automatically. Second, the library might be asked to read from the standard input stream. in that case, ...

2009/08/19 21:01
104

没有更多内容

加载失败,请刷新页面

没有更多内容

返回顶部
顶部