Variable and basic type
来源:互联网 发布:策划 知乎 编辑:程序博客网 时间:2024/05/18 06:09
extern int i;//declares but does not define i
int i(0);//declares and defines I, init i as 0
extern int i=1;//initial i as 1
Can declares multiple times, but only can define one time.
Const key
const object cannot be modified so that it should initial when it was defined.
//file_1.cc
int counter;//uses counter form file_1
//file_2.cc
extern int count;//use counter from file_1
++counter;//increase counter defined in file_1
//file_1.cc
//defines and initializes a const that is accessible to other files
Extern const int bufSize=fcn();
//file_2.cc
Extern const int bufSize;//uses bufSize from file_1.cc
//uses bufSize defined in file_1
For(int index=0;index!=bufSize;++index)
//…
Typedef
typedef double wages;
wages hourly, weekly;
Enumeration
enum open_modes{input, output, append};
Enumeration member's value is a constant expression
enum Points{point2d=2, point2w, point3d=3, point3w}:
Interface and Implementation
Default access level: struct is public, class is private;
Header file(.h)
.h file is used for declaration, but not definition.
Some const object defined in header file
Header Guard(Preprocess defined)
#ifndef TEST_H
#define TEST_H
//Definition of Test class and related functions goes here
#endif
Terminology:
Access label
Address
Arithmetic type
Array
Byte
Class
Class member
Compound type
Const reference
Constant expression
Constructor
Copy-initialization
Data member
Declaration
Default constructor
Definition
Direct-initilization
Enumeration
Enumerator
Escape sequence
Global scope
Header
Header guard
Identifier
Implementation
Initialized
Integral type
Interface
Link
Literal constant
Local scope
Lvalue
Magic number
Nonconst reference
Nonprintable character
Object
Preprocessor
Private member
Public member
Reference
Run time
Rvalue
Scope
Separate compilation
Signed
Statically typed
Struct
Type-checking
Type specifier
Typedef
Undefined behavior
Uninitialized
Unsigned
Variable initialization
Void type
word
- Variable and basic type
- Basic date type and system
- !!!Chapter 2 Variable and Basic Types (2.1 ~ 2.3)
- !!!Chapter 2 Variable and Basic Types (2.4 ~ 2.9)
- variable type of buffer_handle_t
- global variable and local variable
- PHP - Manual手册 - Function Reference函数参考 - Variable and Type Related Extensions变量和类型相关扩展 - Variable handling变量操作 - Variable handl
- Basic type XXXX unknown
- Basic type / Idoc type / Message type
- Bex Query variable Type 说明
- Variable and Constant
- thread and share variable
- static function and variable
- 7.3Basic and visual basic
- java programming basic knowledge--variable initialization
- stack auto variable. and struct variable.
- globe variable and local variable testing
- Java static variable and static final variable
- android 反编译
- OUR_MIFARE.dll动态库使用说明
- the way to find love
- mysql -注释语法
- spring面试大全(二)
- Variable and basic type
- 学计算机的你伤不起啊!
- HBase信息,这个博客日志写的不错,直接转链接
- Standard library type
- oracle中oradim的pfile参数
- Gridview中HyperLink的NavigateUrl绑定问题
- Array and pointor
- MyEclipse For Spring 注册码 及算法
- spring面试大全(三)