Phpcout & lt;

Source: Internet
Author: User
Cout & lt; if the operator is followed by a constant integer, the maximum output value is 4294967295, that is, 2 ^ 32-1. negative numbers are not allowed, that is, cout & lt; & lt; operators only reload the unsignedint type for regular integers. if there is a decimal number, 6 valid digits are retained. that is to say, the sum of the digits of an integer and a decimal number should not exceed 6 digits. if the decimal number is too long, the system will show a rounding to 6 digits. if the integer length is too long, it will also become 6 digits.

For example:
Cout <123.4567 results in 123.457,
Cout <123.4564 results in 123.456,
Cout <123456.1 results in 123456,
Cout <123456.5 results in 123457
For a constant string, the length is theoretically infinite, but the restriction of the VC ++ compiler is received. if the length of a regular string reaches the point where a line break occurs, it will cause a compilation error, that is, cout < <When followed by a regular string, the length of the string is limited to one line in the compiler.
For cout < <Variables added after:
Let's talk about the case with decimals, which is slightly different from the number of constants. the output result is related to the type of the variable. The int type is output based on the prototype, and the double type is 6 bits (including 6 bits) output by prototype, more than 6 members are output by scientific and technological means, and other types are similar. By the way, the int type ranges from-214783648 ~ 214780647, a total of 2 ^ 32 power numbers, even if the value is out of bounds, the compiler will not report errors, nor warning, so be careful, have a common sense, if it indicates the global population (about 6 billion), double or long double type should be used. Other types cannot be used. for variable strings, that is, char arrays, I have not found any restrictions, because I write:
Char v [50000];
Memset (v, 1,49999 );
Cout < There are countless small circles (ASCII code 1) on the screen, even if memset is used for cross-border assignment, there is no problem.

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.