I would expect the following code to output hello5. Instead, it only outputs hello. It seems to be a problem with trying to output an int to the
hello5
hello
Your code is correct, it writes hello5 on my Windows 7 machine. Maybe the problem is rather that you don't write a std::endl or something which might confuse your OS.