C and C + + keyword differences

Source: Internet
Author: User

The data type in C is a struct,
C + + can be a struct or a class
About C + + in << and >> is the arrow heading that way, like cout<<. This is the flow to the screen,cin>> this is the inflow

cout<< "Dayin"//Print to screen
<<endl carriage return to newline
Cin>> I//keyboard input to I variable
The const modifier defines a constant

const int *A indicates that the defined memory space cannot be modified

int * Const A means that the definition of a cannot be modified, but a pointer can be modified
const INT * Const A indicates that neither pointer nor memory space can be modified
Where the const in C is a counterfeit ()

The Register keyword is the request compiler to let the variable in the register (the Register cannot take the address)

#define and const are the same, undef is the definition of unloading # define

The above summary if there are errors please advise, after all, I summary of these are also just learned summary may not be in place or have errors

C and C + + keyword differences

Related Article

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.