Variable and basic type

简介:   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 ...

 

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 `xxx' has initializer but incomplete type的解决方法
variable `xxx' has initializer but incomplete type的解决方法
477 0
RuntimeError: 'PluginContext' object has no attribute 'set_variable'
RuntimeError: 'PluginContext' object has no attribute 'set_variable'
131 2
使用pageHelper报错 Type definition error: [simple type, classXXXX]
使用pageHelper报错 Type definition error: [simple type, classXXXX]
Property xxx was accessed during render but is not defined on instance
目前el-form的model主要用表单验证的,也就是配合el-form的rules和el-form-item的prop来使用的。不信的话,你可以增加一个rules和prop(为了调用验证方法,也el-form也加一个ref属性,相当于id或者class选择器的意思),但是不写model,然后验证的话,会提示缺少model,导致无法验证成功。
Property xxx was accessed during render but is not defined on instance
The type XXX cannot be resolved. It is indirectly referenced from required .class files
The type XXX cannot be resolved. It is indirectly referenced from required .class files
166 0
Duplicate methods named spliterator with the parameters () and () are inherited from the types Colle
Duplicate methods named spliterator with the parameters () and () are inherited from the types Colle
82 0
【TP5.1】variable type error: array
【TP5.1】variable type error: array
210 0
【TP5.1】variable type error: array
SAP WM 为Storage Type 004激活SUM报错 - Storage types without pick-point stor.type require partial pallet
SAP WM 为Storage Type 004激活SUM报错 - Storage types without pick-point stor.type require partial pallet
SAP WM 为Storage Type 004激活SUM报错 - Storage types without pick-point stor.type require partial pallet
MGA (Managed Global Area) Reference Note (Doc ID 2638904.1)
MGA (Managed Global Area) Reference Note (Doc ID 2638904.1)
372 0
Open quote is expected for attribute "{1}" associated with an element type "id".
Open quote is expected for attribute "{1}" associated with an element type "id".
225 0
Open quote is expected for attribute "{1}" associated with an element type "id".
AI助理

你好,我是AI助理

可以解答问题、推荐解决方案等