lundi 1 juillet 2019

Why does the insertion operator give a different result in std::cout when I use extra brackets without operator overloading?

Based on my understanding, the insertion operator when used with any ostream object like an std::cout, will simply insert the values which follow. But when I use brackets, I am getting a different result than expected. I am trying to understand why does the usage of insertion operator with brackets in the code shown below, give the following result in C++ ?

Code

std::cout << (2 << 3) << std::endl;

Result

16

Aucun commentaire:

Enregistrer un commentaire