The programs I make in MSVC are very slow compared to that of Code::Blocks', why is that? The programs made in Code::Blocks are a lot faster, is this a compiler reason, or what? Can this be fixed?
Either one. Why don't you tell us? In, Code::Blocks, you should be able to see what the equivalent command-line is to compile your code. "Full optimization" for run-time in GCC is the -O3 flag (There's other, more specific options as well, but -O3 in general will do a lot of optimization).
How much difference (in speed) are we talking about? You mention "programs". Are you actually building the same program? Can you show a simple example of a program that runs slower in Visual Studio 2017 than Code Blocks (g++) (I have both on my computer to test).
I am not sure about MSVS, but in Code::Blocks, I am compiling in Debug mode. And yes, as you mentioned, I am building the very same program, I literally copied the header and source files, into a MSVS Solution. And it gave me very slow performance.
Okay, so follow the link I posted and try to turn on full optimization to see if that makes a difference.
And also, compile in Release instead of Debug in Visual Studio. (Configuration Manager --> Active solution configuration -> Release). Also try /O2 in MSVS.