C++ if statement oddity

by Ian Davis on November 28, 2008

in Uncategorized

I found that you can do work such as assigning a variable and executing a method outside of the main expression of an if statement. For example:

if(hRes = GetApplicationState(), NT_SUCCESS(hRes))
{
// Do something
}

Previous post:

Next post: