- Boolean quantity
- Eg:bool b1=a==b;//This example, = is the assignment, = = is the judgment is equal, so first judge whether equal, a if equal to the value of B,B1 is true, otherwise it is false
- BOOL is often used as the result type of a function that checks whether certain conditions are true,
- Eg:bool Greater (int a,int b) {return a>b}
- BOOL can be implicitly converted to integers (any nonzero integer is true, 0 is false)
-
- Eg:bool a=ture;
- BOOL B=true;
- BOOL x=a+b;//Because a+b=2 is true, so X is also Tru
- Bool y=a|b;//a/b=1, so y is true
- Character type
- A char type contains 8-bit bits number that can hold different values in 256
- Integer type
- Floating point Type
- Big
-
- sizeof (char) = 1
- sizeof (short) = 2
- sizeof (float) = 2
- sizeof (int) = 4
- sizeof (double) = 8
- sizeof (void*) = 4
- sizeof (LONG) = 4
- sizeof (Longlong) = 8
- sizeof (BOOL) =
- sizeof (wchar_t) = 2
- Void
-
- Used to characterize a function void f () that does not return a merit;
- The underlying type used as a pointer to an object of unknown type, which allows the pointer to be cast to any type of void * PV;
- A special example:
-
- Pointer to type char:
- Char c= ' V ';
- cout<<c<<endl;
- Cout<<&c<<endl;//char type of data, the output address is not used & symbol
- cout<< (void *) c<<endl;//can be output using the (void*) pointer, which can also be coerced into other types of pointers
- cout<< (double *) C<<endl
- return 0;
- Enumeration
- Statement
-
- In addition to functions and namespaces, other declarations should end with semicolons
- Name of the statement
- The best name to get a comparative standard, easy to read. Eg:current_token
- Scope of the name:
- It is generally starting from the place where the name declaration begins to the place where the function block ends to become the scope of the name
- If a global variable and a local variable are the same name, the global variable is obscured locally, and if you want to call a global variable, you can do so through the scope resolution operator:: Make the call.
- Initialization of the Declaration
-
- If not initialized: Global, namespace, local static objects are initialized to the corresponding 0
- However, local objects and dynamic objects are not initialized;
-
- For example:
- Int Main () {
- Int x;//Here is the dynamic variable, no initial
- }
- Typedef
-
- You can change a name to another name: typedef unsign CHAR uchar;//unsign char with a long name into the Uchar type
C + + Note fourth--types and declarations