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 and write code in text editors, and finally run it in a prompt?
If the answer is yes, how?
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).
You can compile programs for Windows (if that's what he meant) from the command line using all the available tools in the Windows SDK (formerly called the Platform SDK, I believe) which is free to download from Microsoft. I think it has all the same tools Visual Studio has if not most of them.
Download Cygwin and make sure to install GCC, the GNU C compiler.
You can write your C programs in a text editor, compile them with GCC, and then execute them.
Of course! There are a bunch of C compilers available for Windows, a few one to get you going:
As for a text editor, you might want to choose one that comes with C-syntax highlighting, like vi, Emacs or some other text editor. Mastering an editor is by the way really useful, regardless of what your language is.
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:
Then, use the gcc compiler to compile it, creating an executable called foo.exe:
lastly, run foo.exe from the command line:
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.