Why should it find errors? The code is valid C++, it just doesn't do what you wnt. Zlatko already told you how to correct it.