In this case, the expression 5 + 3.14 evaluates to the number 8.14. An expression is executed by evaluation, simple as that. To execute this statement, we must execute the expression it contains. This function makes up the main (and in this case, only) part of our program. Types will be discussed in a later chapter.īy doing this, the statement '5 + 3.14 ' has been made a part of a so-called function 'main'. The word int denotes the return type of function main. Any C++ program we write will be composed of a sequence of statements, like the ones we have just written, enclosed inside a piece of magic called the function 'main'.įor example, to make a program out of the statement 5 + 3.14
0 Comments
Leave a Reply. |