How to develop C programmes without an IDE in Wind

2020-06-17 05:58发布

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?

标签: c ide
11条回答
姐就是有狂的资本
2楼-- · 2020-06-17 06:26

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).

查看更多
倾城 Initia
3楼-- · 2020-06-17 06:27

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.

查看更多
来,给爷笑一个
4楼-- · 2020-06-17 06:29

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.

查看更多
萌系小妹纸
5楼-- · 2020-06-17 06:30

Of course! There are a bunch of C compilers available for Windows, a few one to get you going:

  • Visual Studio has an express edition which is free and comes with a compiler
  • MinGW is the Gnu C Compiler ready-to-run for windows
  • There are plenty of others, but the ones above should be .. enough for now

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.

查看更多
放我归山
6楼-- · 2020-06-17 06:33

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
查看更多
聊天终结者
7楼-- · 2020-06-17 06:41

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.

查看更多
登录 后发表回答