How "()" works and why
саша савельев
sany2k13@mail.ru
Sun Feb 9 15:38:51 GMT 2025
To whom it may concern
Me and my classmates found strange behaviour of «()» (in C++) on IT lesson, but our teacher couldn’t anwer us why it works in this way. After, we had tryed to find out by ourselfs, but we found nothing. We understood HOW it works, but not WHY. Could you explane it for us?
std::cout << (std::cout.fixed, std::cout.precision(100), acos(-1));
This code will call all functions in order (we think any combinations of functions will be called in order, so might its behavior is defined), but «()» will return only last value (return from acos(-1)).
Alexander and his friends
More information about the Gcc
mailing list