Difference between CodeBlocks and Visual C++ in syntax?

I use codblocks and am a beginner programmer, and find codeblocks to be simple. I see some people that use visual studio to use things like system(pause) and std::get (something like that) and other weird stuff. What are all these stuff and what differences are there in codes written on codeBlocks and Microsoft Visual Studio?


Different compilers does not require different syntax. The things you have seen are just other ways of using the same language.

Some ppl use using namespace std; and some like to implement the std:: from case to case.

Every system action are the precoded language of windows console.

system("PAUSE"); is equal to open up CMD and type in : PAUSE. You can also use other commands like echo, color etc. system("echo *followed by text*"); for example
No difference really. You also have to use std:: in codeblocks, unless you have using namespace std;

(dont recommend it btw) at the top. And the system thing, thats specifically for windows. In visual studio, you dont have to include the windows header to use system("pause"); But if you want to use it in codeblocks, you would just do

#include <windows.h>
Last edited on
On Windows the console window often close down as soon as the program ends. This can be a problem if the program outputs text that the user has no time to read. system("pause"), cin.get(), etc. are often used by people learning C++ on Windows as a simple hack to delay the termination of the program so that the user has time to read the output.

If you write programs that should run on multiple operating systems (Windows, Linux, Mac OS X, etc.) you should not use std::system or anything from windows.h.
Last edited on
Topic archived. No new replies allowed.