Well, for that you will first use a text editor to write you program and then compile your program using command line. Different compilers have different command line options. You can see your compiler's help file for those options or search over net.
Although i would advise you to use an IDE. If you use cmd compilers, you will first have to go through the trouble of setting up the compiler (Which involves much more than installing it, believe me), then writing your code, then compiling. Compiling itself can be a hassle, with your compiler firstly being reluctant to compiler unless the source file is in the same folder as it, etc etc.
IDE's make work much simpler, things are done in a few clicks. Code::blocks is an easy-to-use IDE with a built-in compiler, and the ability to add compilers. Why not use it instead?
I see, well my instructor told us to try coding c++ without an IDE I downloaded a compiler but it is very confusing to use, thanks for the reply
Your instructors got to be old fashioned :P
Well, i s'pose you'll have to use it then, but keep in mind, all stand-alone compilers are complex to use. Getting them to work is almost as much of a hassle as coding C++ :P