C + + Learning 1

Source: Internet
Author: User

1. Stream extraction operator >>: read operation, called (from stream) extraction

Insert operator for stream <<: write operation, called (to stream) insert

for (int val = 1;val <=; ++val)

{Loop Body}

Execution process:

  1. Create the variable Val and initialize it to 1;
  2. Detects if Val is less than or equal to 10, and executes the For loop body if the detection succeeds. If detection fails, exits the loop and resumes execution of the first statement after the for loop body.
  3. Increase the Val value by 1.
  4. Repeat the condition detection in step 2nd to continue with the remaining steps as long as the condition is true.

Re-explore the compilation

Compile errors that are common:

  1. Syntax error (syntax error): semicolon, etc.
  2. Type error:
  3. Declaration error (Declaration error):

(1): Forget to use STD from the name of the standard library:

(2): identifier name spelling error

The range of values that a type can represent determines the process of conversion:

  1. When an arithmetic value of a non-Boolean type is assigned to a Boolean type, the initial value is 0 and the result is false, otherwise the result is true.
  2. When a Boolean value is assigned to a non-Boolean type, the initial value is false and the result is 0, the initial value is true and the result is 1

C + + Learning 1

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.