I’m new in programming for Windows with C++.
I compiled this code successfully with G++ compiler in Linux and in Windows XP with Mingw compiler.
Code:

I call this function so:

But it when I try to compile it with VS C++ 2010 on Windows 7, I get complain:

I can’t get why it’s so. This visual studio is so strange.
The
stdheaders can include one another, but it’s not mandated which ones should include which. Your safest bet is to have:at the top of the file.
My guess is the compilers that did compile the code had these headers included indirectly, whereas VS doesn’t. Which is fine. The programmer is responsible for including all headers he needs.