A variable is a temporary place for storing data in a program. Only one variable or multiple variables can be used in the Code. The variables can store words, values, dates, and attributes. However, over the years, has the status of the C ++ community improved?
But first, we should see that the current programs are all included in the class, that is to say, all the Defined variables have become private members of the class, if you want to use C ++ variables in other classes, you need to add the constraint character "public" before defining the statement. In C ++, we have seen the following:
- Bool;
-
- If (A=Getnum() // Assume that Getnum returns an integer.
-
- {
-
- // A is not 0
-
- }
-
- Else
-
- {
-
- // A is 0
-
- }
A and B are all public, because public: is used, but such a statement is absent in C ++. I personally think this is actually good, concise, and clear, in C ++, you must add a delimiter to each variable:
- Using System;
-
- Namespace ConsoleApplication1
-
- {
-
- Class Class1
-
- {
-
- Static void Main (string [] args)
-
- {
-
- Int [,]A1=NewInt [2, 2] {1, 2}, {3, 4 }};
-
- Foreach (int B 1 in a1)
-
- {
-
- Console. WriteLine ("{0}", b1); // operations on the unchanged long array
-
- }
-
- Int [] []A2=NewInt [2] [];
-
- A2 [0] = new int [2] {0, 1 };
-
- A2 [1] = new int [3] {3, 4, 5 };
-
- Foreach (int [] B 20 in a2)
-
- {
-
- Foreach (int B 21 in b20)
-
- Console. WriteLine ("{0}", b21); // operations on the variable-length Array
-
- }
-
- }
-
- }
-
- }
The const keyword is used for constant definition, which is similar to C ++. it differs from read-only delimiters. 1. constant is static 2. you must assign values during initialization and do not understand the actual meaning. It is found that C ++ variables are also a cumbersome language. The above four operators can be used in insecure code of C ++ variables, but they are incorrect in General C # code. C # removes the pointer, operators related to pointers cannot be used.
- Differences between standard input implementation methods in C and C ++
- How does the C ++ compiler allocate storage space for Const constants?
- Basic Conception and method of C ++ Class Library Design
- Several Methods for converting C ++ Language
- How to better compile C ++ code