C Learning Notes (i) data, operators, expressions

Source: Internet
Author: User

Note: Based on learning rectification C program design, online search for personal summary of some practical application of knowledge

The data has integer type, floating point type, character type data

(1) Define Integer data:

Integer (int) 16-bit 2-byte -32768~32767

Short int 16 bits 2 bytes -32768~32767

Long int 32 bits 4 bytes

unsigned integer (unsigned int) 16-bit 2-byte 0~65535

unsigned short integer (unsigned) 16-bit 2-byte 0~65535

unsigned long integer (unsigned long int) 32 bits 4 bytes

Decimal, octal (0 flag), Hex (0x flag)

(2) Define floating-point data:

Single-precision floating-point (float) 32-bit 4-byte

Double-precision floating-point (double) 64-bit 8-byte

Long double precision floating point type (long double) 128 bits

Note: Floating-point data operations sometimes have rounding errors

(3) Define the character type data:

Character data (char) 8 bits 1 bytes

unsigned character data (unsigned char) 8 bits 1 bytes

(4) Constants

Integral type constant: 1,2,3,4 ...

Real constants: 1.2,-0.12 ....

Character constants: ' A ', ' B ' ... a=97 a=65

Symbolic constants: Constants defined #define NUM 30 macros

(5) Variables

A person thinks that defining a variable is a container in memory that can change the contents of a container, but the container itself will not change.

For example, a variable of type int a,a can be either 1 or 2, but the address and type of a will not change.

Note: 1. Variables can only consist of letters, numbers, underscores, and the first character must be a letter or underline

2. Variables are case-sensitive, for example, int num and int num represent two variables

   

C Learning Notes (i) data, operators, expressions

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.