The first c ++ program and the first c ++ Program
The first c ++ Program
# Include <iostream>
Using namespace std;
Int main (int argc, const char * argv [])
{
// Cin receives keyboard input
Int age;
Double height;
Char name [10];
// Cout outputs some information on the console
// Equivalent to the printf function in C Language
// Equivalent to NSLog in oc
Cout <"Enter age ";
Cin> age;
// Std: cout
// The cout object is defined in the std namespace
Cout <"Enter height ";
Cin> height;
Cout <"Enter name \ n ";
// Cin> name;
Cin. get (name, 10 );
// Endl: end line
// Operator re-cutting
Cout <"my age is" <age <", height is"
Return 0;
}
C-free 5 can only run the first program. If it is a program, you can compile and run multiple programs. If it is a project, you can only run one program.
The first answer to the question of the first program in C language is really nonsense. main (void) has no parameter and does not return the value of void main (). Do you see if it is # include and <stdio. h> there is no space between them. Some compilers do not need spaces, such as Qt Creator and vs2012, But I need spaces in keil. You can check if this is the reason, if not, send the cause of the error.