I am kind of newbie in using c++. I have a quick question, probably a dumb question.
streamsize prec = cout.precision(3);
As I understand correctly this declaration works like that: set the cout
precision to 3, but assign the previous precision value to prec
.
Also, simply, we can assign a function result (say a math addition function) to a variable:
int z = addition(3,4);
In the second one, it does the calculation and assigns the results to the variable z
, not the previous value or a default value. Is my understanding correct? What is the difference between them?