This is for Code::Blocks 16.01 with the GNU GCC compiler (although I think it's been available for earlier versions): If you have a source code file open in Code::Blocks, you can compile it by first selecting the open file / tab, then go to the menu and select Build / Compile current file, which has the keyboard shortcut: Ctrl + Shift + F9.
(It would be nice if this was available in Code::Blocks as a right click menu option on the open file tab itself.)
Results will be shown on the "Build messages" log, make sure you have it selected. If the file has already been compiled, nothing much will happen apart from the display of "||=== Build file: Debug in <project name> (compiler: GNU GCC Compiler) ===|".