C Language notes, C Language
Recently I have been studying the C language. Here are some tips or tips I have learned in C Language Learning:
1. obtain the maximum value of the Integer Data Type
Many constants are predefined in the ANSI standard header file limits. h, which hold the maximum or minimum values of various types.
CHAR_BIT: binary digits of the char type (bit)
SCHAR_MIN: minimum value of the signed char decimal integer, SCHAR_MAX: maximum value of the signed char decimal integer, and UCHAR_MAX: maximum value of the unsigned char decimal integer
SHRT_MIN: Minimum value of short's decimal integer, SHRT_MAX: maximum value of short's decimal integer, and USHRT_MAX: maximum value of unsigned short int's decimal integer
INT_MIN: minimum value of the int decimal integer, maximum value of the INT_MAX: int decimal integer, and maximum value of the UINT_MAX: unsigned int decimal integer
LONG_MIN: the minimum value of a long decimal integer, the maximum value of a LONG_MAX: long decimal integer, and the maximum value of a ULONG_MAX: unsigned long int
LLONG_MIN: minimum value of the long decimal integer, LLONG_MAX: maximum value of the long decimal integer, and ULLONG_MAX: unsigned long decimal integer
Note: long is the new integer type extended by C99.
You can also use the knowledge of composition principles, such as taking a 32-bit int as an example: printf ("% d \ n ",~ (Unsigned int) 0/2 );
C language laptop Sales Management System
Sent...
How to take notes when learning C Language
When I learned C language by myself, I only recorded the notes in the program, and then wrote the new knowledge in the program next to the program, such
When I first learned
# Include <stdio. h>
Main ()
{
Printf ("Hello! ");
}
The basic format of each C program is:
# Include <stdio. h>
Main ()
{
Printf ("Hello! ");
}
Later I learned
# Include <stdio. h>
Main ()
{
Int x; ----- declare the variable to be used first,
X = 1;
Printf ("x = % d", x); ---- ^ .....
}
So far, I can run the program without understanding it. I feel pretty good, that is, sometimes I have to write too much.