what's an expression and expression statement in c++?

前端 未结 7 1718
遇见更好的自我
遇见更好的自我 2020-12-04 12:42

I\'ve read that usually statements in c++ end with a semi-colon; so that might help explain what an expression statement would be. But then what would you call an expression

7条回答
  •  悲哀的现实
    2020-12-04 13:05

    According to The C++ Programming Language by Bjarne Stroustrup Special(3rd) Edition, a statement is basically any declaration, function call, assignment, or conditional. Though, if you look at the grammar, it is much more complicated than that. An expression, in simple terms, is any math or logical operation(s).

    The wikipedia links that ok posted in his answer can be of help too.

提交回复
热议问题