1.1 Writing a Simple C++ Program

来源:互联网 发布:网红开的淘宝店有哪些 编辑:程序博客网 时间:2024/05/29 00:34

Writing a Simple C++ Program

 

int main()     

{

  return 0;

}

A function definition has four elements:a return type,a function name,a(possibly empty)parameter list enclosed in parentheses,a function body.

 

Note

Note the semicolon at the end of the return statement.Semicolons mark the end of most statements in C++.They are easy to overlook but,when forgotten,can lead to mysterious compiler

error messages.

 

Key Concept:Types

Types are one of most fundamental concepts in programming and a concept that we will come back to over and over in this Primer.A type defines both the contents of adata element and the operations that are possible on those data.

    The data our programs manipulate are stored in variables and every variable has a type.When the type of a variable named v is T, we often say thatv has type Tor,interchangeably,thatv is a T. 

 

0 0
原创粉丝点击