Defining variables is essential when writing programs, and some basic data types are used.
Perhaps you would say that it is easy to define a variable with any difficulty. To define an integer variable, use "int i;" directly. statement, and to define character variables, use "char C;" directly. It's OK. Indeed, this is what school education teaches us, but it cannot be done in practical work.
Why, then? The reason is simple, because the program is written so that it looks very "cottage", not a professional programmer should do things.
Some time ago, I was watching " Chu Han legend ", there is a scene left me a very deep impression. When Liu Bang for the first time to find the help of Xiang Yu, they saw a line of Xiang Yu Camp is how to training, think of their own training methods, then shocked. Liu Bang they are completely like a group of no norms, running around the farmers, compared with Hang Jiajun, really bad far. This difference is transplanted to software development, which is the difference between " Shanzhai " and " professional ". Although this analogy is a bit inappropriate, it also shows a certain truth.
The basic data types of books to go to school is like a child who is not sensible, only to carry out certain norms and training, in order to get out of society, can be used for units.
Based on your own work experience, some of the basic data types that are commonly used are redefined (normalized) as follows:
(1) Integral type
An integral type that consists of a short int, an integer (int), and a long integer (long int) with a number of digits to include unsigned integer (unsigned) and signed Int (signed).
For unsigned short integers, it is redefined as: typedef unsigned-intUINT16;
For a signed short integer, it is redefined as: TypeDef signed-intINT16;
For unsigned integral type, it is redefined as: typedef unsigned INTUINT32;
For signed integral type, it is redefined as: TypeDef signed INTINT32;
For unsigned long integer, it is redefined as: typedef unsigned longulong;
For signed long Integer, it is redefined as: TypeDef signed Longlong;
By redefining the above, we can use UINT16, INT16, UINT32, INT32, ulong, and long to replace the corresponding integer type. Here take UINT32 to explain: "U" stands for "unsigned", "int" represents "int", "32" means "32 bits", from this definition you can see that this represents a 32-bit unsigned integer data type, and if you want to define one such variable i, use "UINT32 i;" The statement is OK.
More Wonderful content: http://www.bianceng.cnhttp://www.bianceng.cn/Programming/project/