variables - Why literals are considered expressions in C++? -
variables - Why literals are considered expressions in C++? -
i'm studying c++ programming language using programming priciples , practice using c++. i'm in chapter 4 , in chapter book introduces concept of expression, can't understand @ :
the basic building block in programme expression. espression compute value number of operands. simplest look in c++ literal value such 11, 'c', "hello". names of variables expressions. variable represent object name.
why literal considered look ? why name of variable considered look ?
expressions -in programming languages, in math, in linguistics- defined compositionally (or inductively). expressions made of subexpressions x*2+y*4 made of 2 sub-expressions x*2 , y*4 joined add-on operator +.
but need base of operations case (the atomic , simple expressions). these literals (2) , variables (x) - if either of them not look 2*x not look (since both operands of binary multiplication * sub-expressions).
notice in c , c++ assignments , function calls expressions
c++ variables expression literals
Comments
Post a Comment