A value of a shape such as 42 is called a literal constant. The form and value of a literal constant determines the type of the constant. For example, 0x42 is an integer constant of 16 binary representations. ' A ' is a char literal. Literal
Data representation literal integer literalTo write a program, the first thing to face is data. How is the data represented in the program? Data is usually represented in two ways, depending on how it is represented: visual representation and
The literal amount of an integer
You can represent an integer literal in a very straightforward way. Here are some examples:
–123 +123 123 22333
Among them, the "+" and "–" numbers in the first two examples are the unary operators mentioned
Data representation literal integer literalto write a program, the first thing to face is data. How is the data represented in the program? Data is usually represented in two ways, depending on how it is represented: visual representation and
Table of Contents 1. Direct writing binary literal constant
1 direct writing binary literal constants
C++14 brings a 0b or 0B beginning to represent the literal constants of the binary string, becoming the binary literals. The following code
void
Literal quantityIn computer science, the literal (literal) is a representation of a fixed value (natation) used to express a source code. Almost all computer programming languages have literal representations of basic values, such as integers,
Literal literals See what is what. For example, if we want to represent a number in the program, we write a number. To represent "Hello" in your program, you need to enclose the quotation marks. These writing rules are called literal quantities.
Objective
A few years ago, when SpiderMonkey implemented a rigorous model. I learned that strict mode disables the octal integer literal. Because there is evidence that some beginners will use the leading 0来 to align numbers in multiple lines,
Number literal amount
The integer digital surface is written as follows:
· decimal digits, no prefix
· Binary number, prefixed by 0b
· Octal number, prefixed by 0o
· hexadecimal digits, prefixed by 0x
All the following integer literal values
Number literal
The literal expression of an integer is as follows:
· Decimal number, No prefix
· Binary number, Prefixed with 0 B
· October, With the 0o prefix
· Hexadecimal number, Prefixed with 0x
The decimal values of all the following
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.