====== Getting Started on Windows for C/C++ Beginners ======
This article gives step-by-step information from software installation to the completion of a Hello World program.
===== Install TDM-GCC (the compiler) =====
http://tdm-gcc.tdragon.net/download
Choose the 32bit (No -w64 suffix), bundled, sjlj version.
Install it with default options unless you know what you are doing.
===== Make sure that GCC is accessible in PATH =====
You should get something like this in your CMD
C:\>gcc
gcc: fatal error: no input files
compilation terminated.
Otherwise, you should add appropriate PATH manually.
===== Install Geany (the IDE) =====
If you are not sure, download and install the version comes with GTK runtime.
===== Hello World for C =====
#include
int main( void )
{
printf("Hello, World!\n");
return 0;
}
===== Hello World for C++ =====
#include
int main( )
{
std::cout << "Hello, World!\n" << std::endl;
return 0;
}
===== Finish Your Hello World Program =====
* Click "New" in toolbar.
* Type above Hello World program according to your language (C or C++).
* Save the program with proper extension (Use .c for C programs, .cpp or .cxx for C++ programs)
* Click "Build" in toolbar. It should say "Compilation finished successfully.", otherwise check your code.
* Click "Execute" in toolbar. It should popup a console window and you should see "Hello, World!" displayed.
{{tag>howto windows c c++}}