The simplest c program

Source: Internet
Author: User

The simplest c program
Tan haoqiang's book saw 56 pages today. I learned these basic knowledge through other ways in the past few days. This is a review. Some constant variable knowledge, including: 1, an integer constant is a general integer. 2. A real-type constant, which is divided into two decimal forms, consisting of digits and decimal places, such as 1.453 3. A character constant, which can be divided into common characters and escape characters, common characters must be enclosed by a single marker, for example, 'a '3 ''! 'Cannot be written as 'AB'. character constants are stored in code (refer to ASCII code ). Escape Character sequences starting with \, for example, 40 pages of \ n textbooks, table 4, string constants, such as "boy" and "123, note that a single marker can contain only one character, and a double marker can contain one character string. 5. symbol constant. Use the # define command to specify a symbol name to represent a constant. I have understood the concepts in the books I copied above. I don't feel it is necessary to talk about variables. I understand them very well, haha. Integer Data: A Basic INTEGER (int). The Compiler assigns two or four bytes to it, one of which is eight digits. The storage unit stores the data in an integer complement mode, I still don't know what a supplementary code is! In my understanding, decimal data is converted into binary data and then stored in those bytes. If there are two bytes, there should be eight digits to store the binary data, for example, if the binary value of 5 is 101, 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 1 The first 0 represents a positive number, therefore, the maximum value is 0111111111111111, that is, 32767. If the first number is 1, it indicates a negative number. The minimum value can only be 1000000000000000, that is,-32768 in decimal format. Therefore, the range is-32768 ~ 32767. This is the case of two bytes! The short int or short long integer is the long int or long Double long integer long int or long variable value range I do not know whether to remember, there are p45 in the book. In addition, the "signed" and "unsigned" symbols are only positive, plus the modifier unsigned. The signed modifier signed is generally omitted, for example, unsigned int; of course, if there is an unsigned type, the first 0 and 1 are not both positive and negative, so the above range is changed to 0 ~ 65535 is easy to understand! I want to remember the character variable. The character variable defines the character variable with the type character char. For example, char c = '? 'Define c as a character variable ,'? 'Ascii code is 63. The system assigns the integer 63 to the variable c. in decimal format, % d is used to output % cprintf ("% d % c \ n", c, c); the output is: 63? Similarly, unsigned char can extend the value range to 0 ~ 255, char is-128 ~ 127, but the Code cannot be negative. Therefore, 0 ~ is valid for storing characters ~ 127 floating point variables need to be viewed again!

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.