The problem is you don't seem to be trying. You don't even need five MINUTES of C++ education to use the trick I just used above.
In fact, you could get half way throught the whole language if you applied that 5 minutes to reading Learn C++ in 10 Minutes.