C + + Basics

Source: Internet
Author: User

1. Naming rules for identifiers:

(1) consisting of English letters, numerals and underscores;

(2) The size of the English alphabet to be differentiated;

(3) Do not allow the use of numbers to begin;

(4) You cannot use keywords in C + +.


2. C + + provides const keyword declaration constants, const represents a "constant value variable", that is, a variable that cannot change the value.


3, 4294967295 is 32 is the CPU register and the visual c++6.0 compiler allows the maximum number of positive integers.


4, Integral type constant:

(1) Decimal integer constant: The decimal integer constant is made up of 0~9 numbers. Cannot start with 0, no decimal part.

(2) Octal integer constant: octal form the integer constant must begin with 0, which is prefixed with 0 as the octal number.

(3) Hexadecimal integer constant: the prefix for hexadecimal integer constants is 0X or 0x. Consists of 0~9 numbers and a~f (a~f the same size).

Real-Type constants:

(1) fractional notation;

(2) Scientific notation: The exponent part begins with the symbol "E" or "E", but must be an integer, and the symbol "E" or "E" must have at least one digit on either side. Example: 1.2e20, -3.4e-2


5. Data type:

The number of bytes that the type occupies

Char 1

BOOL 1

Short 2

int 4

Long 4

Float 4

Double 8

Long Doubel 8


6.



C + + Basics

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.