Linux C Program (both)

Source: Internet
Author: User

1. String constant double quotation mark "": Eg: "China", when the string is stored, it will be the end flag with a.
2. Symbolic constants, give the constants a name.

1#include <stdio.h>2 #definePI 3.1415926//Symbolic constant Pi3 intMain () {4     floatR =2.56;5     floatl, S;6         7L =2*pi*R;8s = pi*r*R;9printf"L =%f \ n", L);Tenprintf"s =%f \ n", s); One     return 0; A}

3. Operators and expressions

1 // pointer operator *,& 2 // Subscript operator [] 3 // component operator .,-> 4 // Bitwise operators >>,<<,~,|,^,& 5 6 // type inconsistency: Short and char are automatically converted to int, float is automatically converted to double, and if all float is converted back to float

Question: 100+ ' A '-60.25
Operation process: ' A ' is converted to int 65, with float-60.25,100 and 65 converted to double operation 100.0+65.0-60.25 finally converted back to float


Linux C Program (both)

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.