On Windows you could install the free version of Visual C++ Express (or buy a licence for one of the full versions of VS) and use the Visual Studio IDE and compiler. Or you could use a free IDE like Code::Blocks with Mingw (windows port of the gcc/g++ compilers). Or if you want to compile from the command line, without an IDE you could install Cygwin (a Unix-like terminal environment for Windows with ports of common Unix/Linux tools including gcc/g++, make, cmake etc)
On Linux you could install gcc/g++ with some additional command-line build tools (gnu make, cmake, autotools etc). And if you want to use an IDE for C/C++ there are many available for install too - Code::Blocks, CodeLite, KDevelop, Geany, Anjuta, Eclipse etc..
The choice is yours! And my list above is not exhaustive by any means. There are tons of other free compilers out there that I have not mentioned like llvm/clang! Or Eclipse (Java IDE), which can be used as a C/C++ IDE via a plugin.