如何开发C程序,而在Windows中一个IDE? [英] How to develop C programmes without an IDE in Windows?

查看:79
本文介绍了如何开发C程序,而在Windows中一个IDE?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想有怎样的C程序的运行有更深的了解。

I want to have a deeper understanding of how C programmes are run.

不过的IDE阻止我们这样做。

But IDEs stops us from doing that.

那么,这可能是我手动设置在文本编辑器环境和写code,最后在提示符下运行?

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?

推荐答案

正如其他人所说,安装 MinGW的(我假设您使用的是Windows),并把它的bin目录路径中。打开命令行窗口,并创建一个文本编辑器如记事本的文件 - 称之为foo.c的:

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;
}

然后,使用GCC编译器来编译它,创建一个名为foo.exe的可执行文件:

Then, use the gcc compiler to compile it, creating an executable called foo.exe:

> gcc foo.c -o foo.exe

最后,在命令行运行foo.exe的:

lastly, run foo.exe from the command line:

> foo.exe
hello world

这篇关于如何开发C程序,而在Windows中一个IDE?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆