One character in the C language corresponds to an ASCII code, a 1-byte 8 bits, and a binary representation of ASCII decimal in memory.

Source: Internet
Author: User

/** read-only variables and constants const READ-only const int A;int const a;//are equivalent to the above line of code, all representing a constant shape number. int *const A;//const has a "left associative", that is, a const modifier *, then, it is not difficult to understand that the sentence represents a constant pointer to an integer, a pointer to an integer can be modified, but pointer a cannot be modified. The const int *a;//is equivalent to the following line, which, according to the "left associative" nature, is the const modifier (*a), which is an integer, so the two sentences indicate that the pointer points to a constant integer. The int const *a;int Const *A const;//is based on the "left associative" nature, the first const modifier (*), and the second const modifier (a), so that this sentence represents a constant pointer to a constant integer. **/#include <stdio.h> #define PI 3.145926145926int Main (void) {const int a = 10;//cannot modify constant constant, invariant int const B = 2.3e2;// Can not modify the equivalent of the above 2*10 2 times E to 10 as the base of the power//may modify the variable with the pointer//int *p = &a;//pointer can be changed//*P = 55;//printf ("%07.3f\n", PI); The value retains 3 decimal places, including a total of 7 decimal places; 0//int c = sizeof (float); int float long takes 4 bytes 32 bits char c = ' a '; A character or letter occupies 1 bytes 8 bits The smallest is 1-255//c = sizeof (c);p rintf ("%d", c),//97 output is ASCII 01100010 is a means that the characters are also binary access return 0;}

  

One character in the C language corresponds to an ASCII code, a 1-byte 8 bits, and a binary representation of ASCII decimal in memory.

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.