1.10 Introduction to expressions

주홍영·2022년 3월 10일
0

Learncpp.com

목록 보기
22/199

https://www.learncpp.com/cpp-tutorial/introduction-to-expressions/

An expression is a combination of literals, variables, operators, and function calls that can be executed to produce a singular value. The process of executing an expression is called evaluation, and the single value produced is called the result of the expression.

따라서

type identifier { expression };

literal도 variable도 operand with opertor도 모두 expression이므로

Rule

Values calculated in an expression are discarded at the end of the expression.

Quiz

Q1 What is the difference between a statement and an expression?
Statements are used when we want the program to perform an action. Expressions are used when we want the program to calculate a value.

profile
청룡동거주민

0개의 댓글