I am a C++ beginning learner. Recently, I read a paragraph describing the evaluation of an expression. The original text is as below:
"...Evaluation of an expression may generate side-effects, e.g.
std::printf("%d", 4)
prints the character'4'
on the standard output...."
My question is "Why the character '4'
caused by std::printf("%d", 4)
is a side-effect?"
Can anyone give me a more comprehensive explanation or more examples about side-effects evaluated by expressions?
Thanks!