I was reading about the volatile
keyword in c++ and tried this sample piece of code which gave the result as follows:
When I added the volatile keyword to the const var declaration the output became 200 for both vars. Can someone explain what kind of var optimizations the compiler might've done here? Thanks!