C Language notes, C Language

Source: Internet
Author: User

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.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.