I want to have a deeper understanding of how C programmes are run.
But IDEs stops us from doing that.
So is it possible that I manually set up the environment an
As others have said, install MinGW (I'm assuming you are using Windows) and put its bin directory on your path. Open a command line windows, and create a file with a text editor, such as notepad - call it foo.c:
#include <stdio.h>
int main() {
printf( "hello world\n" );
return 0;
}
Then, use the gcc compiler to compile it, creating an executable called foo.exe:
> gcc foo.c -o foo.exe
lastly, run foo.exe from the command line:
> foo.exe
hello world
If you're interested in how large projects are organised, you could try downloading the source code for something like Apache httpd or PHP. These are both in C. On Linux/Mac you can compile them from the command-line using a few simple commands (see the documentation).
If you want to see how the build works, most if not all IDE's create a build log which shows the actual command lines issued to invoke the compiler/linker etc. Nothing prevents you from issuing these commands directly on the command line.
What an IDE typically also does for you is dependency management; this is difficult to maintain manually, and best left to the IDE for large projects.
You do not need to download and install any specific compiler or toolchain as some have suggested; the one you have with your current IDE will be sufficient. For example if you have VC++2008 (or 2008 Express), the command line tools are described here.
Here is some simple step that would make you to compile and run c program without IDE
1 - install the TCC (Turbo C compiler)
2- open Notepad and write C code
3 - save as a.c in C:\TC\BIN
4 - then open CMD
5 - compile c code by "tcc a.c"
6 - finally run "a.exe"
Of course. You'll need something like MinGW compilers set to compile your application (or you could use the IDE-provided compiler). Then just use CMD and execute appropriate compile commands.
Actually, every IDE provides just more easier way to do the same compilation.
You just need to install the MinGW compiler and set path to the gcc executable and you're ready to go. Then you can write C code in editor and compile it in command line just like you would on Linux.