Home PC Games Linux Windows Database Network Programming Server Mobile  
           
  Home \ Programming \ C ++ How to determine the types of constants     - Linux simple commands (Linux)

- A process of how to get the current traffic in GNU Linux (Linux)

- CentOS6 installed Tomcat (Server)

- Source MongoDB 3.2.1 installed on CentOS6.5 (Database)

- Git commands (Linux)

- Digital jQuery scrolling effect (Programming)

- What is the Docker (Linux)

- Linux system performance analysis and top command ps.pstree Comments (Linux)

- mysqldump implement database logical backup (Database)

- Linux modify the network interface name (Linux)

- Use virt-manager to create and manage virtual machines (Linux)

- Oracle 11g RAC installation considerations Miscellany (Database)

- GAMIT 10.50 installed in Ubuntu 12.04 system (Linux)

- MongoDB learning Notes (2) basic connection example of -Nodejs and MongoDB (Database)

- A list of the basics of Python, Ganso, Dictionary (Programming)

- Linux Network Programming - signal blocking and shielding (block, unblock) (Programming)

- Notebook computer forget password solution (Linux)

- How to configure HTTP Strict Transport Security (HSTS) (Linux)

- Deploy Mono 4 and Jexus 5.6 on CentOS7 (Server)

- Specifies the open ports of the SUSE firewall settings (Linux)

 
         
  C ++ How to determine the types of constants
     
  Add Date : 2018-11-21      
         
         
         
  Declaration procedures specific to the type of integer variables tell the C ++ compiler, the compiler knows how to type it constant? Assuming constant in a program to represent a number:

Cout << "year =" << 1492 << "\ n";

1492 program will be stored as int, long, or other cosmetic it? The answer is that, unless there is reason to store other types (such as using a special suffix to represent a specific type, or too much, can not be stored as int), otherwise c ++ will be stored as an integer constant of type int.

First look suffix. Suffix is placed after the number of constants letter indicates the type. Integer behind l or L suffix indicates that a long integer constant, u or U suffix unsigned int constant, ul (you can use any kind of order, uppercase lowercase) indicates unsigned long constants (due lowercase l looks like 1, Therefore, you should use as a capital L suffix). For example, in a 16-bit int, long for the 32-bit systems, digital 22022 is stored as int, accounting for 16, is stored as digital 22022L long, accounting for 32. Similarly, 22022LU and 22022UL are stored as unsigned long.

Next, study length. In c ++, the rules adopted by a decimal integer, hexadecimal and octal is slightly different. For decimal integer without the suffix, using the following types can be stored in the minimum number to represent the type: int, long, or unsigned long. On a 16-bit int, long 32-bit computer system, 20,000 are represented int type, long type is represented as 40,000, 3 billion is represented as unsigned long type. For hexadecimal or octal integer without the suffix, using the following types can be stored in the minimum number to represent the type int, unsigned int, long, or unsigned long. In the long represented as 40,000 computer system, hexadecimal number 0x9C40 (40000) will be represented as unsigned int. This is because the hex used to represent a memory address, and memory address is unsigned, therefore, unsigned int fit to represent more than the long 16-bit address.
     
         
         
         
  More:      
 
- Linux kernel boot to retain large memory method summary (Linux)
- CentOS 6 / Linux su: Unable to set user ID: Resource temporarily unavailable (Linux)
- Ubuntu Install OpenSSL (Linux)
- php performance monitoring module XHProf (Linux)
- CentOS7 Kubernetes used on container management (Server)
- How to install or upgrade to the Linux kernel in Ubuntu 4.2 (Linux)
- Transfer files and permissions from Windows to Linux system by Samba (Linux)
- Linux kernel likely and unlikely to resolve macro definitions (Linux)
- History of the most complex validation e-mail address regular expression (Linux)
- Oracle 12C truncate table cascade (Database)
- Android Studio and Git Git configuration file status (Linux)
- Linux network monitoring strategy (Linux)
- Linux security-related basics (Linux)
- JavaScript prototype and prototype chain and project combat (Programming)
- Git bulk delete remote tag (Linux)
- Examples 14 grep command (Linux)
- Nginx load balancing configuration (TCP proxy) (Server)
- Linux System Getting Started Learning: From VirtualBox from the client host access NAT (Linux)
- Several start-up mode of Tomcat (Server)
- Based AutoYaST automated installation of SUSE practice (Linux)
     
           
     
  CopyRight 2002-2022 newfreesoft.com, All Rights Reserved.