[C + +] using Xcode to write C + + programs [3] Constants

Source: Internet
Author: User

Use Xcode to write C + + programs [3] Constants

Here are some of the basic data meanings:

75         // int75u        // unsigned int75l        // long75ul       // unsigned long 75lu       // unsigned long 
3.14159    // 3.141596.02e23    // 6.02 x 10^231.6e-19    // 1.6 x 10^-193.0        // 3.0 
3.14159L   // long double6.02e23f   // float 
‘z‘        // 单个字符
"How do you do?"  // 字符串


一些符号的含义:


bool类型以及指针
booltrue;boolfalse;intnullptr;


const变量
#include <iostream>using namespacestd;Const DoublePI =3.14159;Const CharNewLine ='\ n';intMain () {DoubleR=5.0;//radius  DoubleCircle; Circle=2* PI *R; cout<<Circle; cout<< newline;

Macro definition:

#include <iostream>usingnamespace  std; #define PI 3.14159#define NEWLINE ' \ n 'int  main ()  {double r=5.0;               // radius  Double Circle;   2 * PI * r;   << Circle;   << NEWLINE;}

 

[C + +] using Xcode to write C + + programs [3] Constants

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.