C ++ beginners, what books do c beginners read?

Source: Internet
Author: User

C ++ beginners, what books do c beginners read?

 

Today, I learned how to write c ++ statements.
Because c was used in programming, the first time I saw some code in c ++, I was a little confused and busy.

When I first came into contact with c ++, I learned the definition of variables and input and output in c ++.

The Code is as follows:

# Include <iostream>
Int main ()
{

Int I;
Float f = 6.1f;
Std: cin> I;
Std: cout <I <"" <f <std: endl;
Return 0;
}

First, when writing the code, the header file used for output in c ++ is very different from that in c. The header file used for output in C is <stdio. h>, while c ++ uses <iostream>

In addition, the output statements of c ++ and c are quite different. The output in c ++ applies the cout function in <iostream>.

The writing format is also different from that of c. The data to be output must be included in <.

On the contrary, we can clearly find that the input is "" ", the direction of the arrow is opposite, and the right arrow is missing compared with the input.

Second, c ++ and c are slightly different in the definition and assignment of variables:

The definition of variables in c ++ is different from that in c ++. The difference lies in the assignment of variables:

C directly input "variable = value" when assigning values to variables, for example:

Float f = 5.2;

In addition to integer variables, c ++ must add a type indicator after the value, for example:

Float f = 5.2f;

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.