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:
- Create the variable Val and initialize it to 1;
- 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.
- Increase the Val value by 1.
- 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:
- Syntax error (syntax error): semicolon, etc.
- Type error:
- 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:
- 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.
- 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