1. How to write a C + + program
A. Each program can have only one main () function, and C + + programs are executed from the main () function.
The b.class mechanism gives us an added level of abstraction within the program.
C. The specific object cin is to eat spaces and line-wrapping.
D. Differences in declarations and definitions:
A declaration makes a name known to the program, and a file must contain a declaration of that name if it wants to use a name defined elsewhere.
Defines the entity responsible for creating the name Association, and also applies for space, which may assign an initial value to the variable.
extern int I//declaration rather than definition
int I//definition rather than declaration
extern int i = 12//definition rather than declaration
650) this.width=650; "style=" Float:none; "title=" tt unnamed. jpg "src=" http://s3.51cto.com/wyfs02/M02/6C/5D/ Wkiol1vikruqbepkaabjptaik1a850.jpg "alt=" Wkiol1vikruqbepkaabjptaik1a850.jpg "/>
650) this.width=650; "style=" Float:none; "title=" 1.jpg "src=" http://s3.51cto.com/wyfs02/M02/6C/61/wKiom1VIJ6yB_ 4znaagfjicuv7m549.jpg "alt=" Wkiom1vij6yb_4znaagfjicuv7m549.jpg "/>
In different files, if you want to share the same data object, do not declare an error, but can not be defined, can only be declared, only the extern representation is a declaration.
Inside the function, an error is raised if an attempt is made to initialize a variable that is marked by the extern keyword. Because extern means that the declaration is not allocating memory space and cannot be assigned, it must be defined first.
This article from "Very blog" blog, reproduced please contact the author!
Crazy C + + 's essential c++01