Programming Basics c--Basic data types:

Source: Internet
Author: User
1. Plastic (base) int basic integral type Long Long integer signed signed (can differentiate positive and negative) unsigned unsigned, negative number will be converted to positive (02) floating point Data flot single-precision floating point type, 6 digits after the decimal point (6 digits of valid digits) Dou BLE double-precision floating point, reserved for 15 bits (15 digits) (03) character data (used to denote real numbers with decimal points) Char character type (with single quotation mark ") for storing letters and punctuation (characters are stored in the computer with binary ASCLL code) printf (" Decimal%.3f\n,1.0 ") If you want to preserve n digits after the decimal point, Use%.NF If there is an integer in an expression, it is also an integer, and if it contains a floating-point type, the resulting result is a floating-point type, which means that the result of the expression depends on the highest level of data type it contains (Char->int->float- Double), which is called automatic type conversion (implicit type conversion) high-to-low when we want to convert from a low-level type to a high-level type, you need to use the coercion type conversion (display type conversion) (post-conversion type) (expression) int = (int) a;int sum= (int) (A + b);

Programming Basics c--Basic data types:

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.