开发者

How to compile and run C code? [closed]

It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center. Closed 11 years开发者_如何学JAVA ago.

I have purchased The C Programming Language ANSI C Version book for learning C. In that, there is no instruction for setting up the environment for developing the C programs.

Please help me how to compile and run the code explained in the book.

EDIT : I have Windows 7 installed as the OS"


You should use an IDE (Integrated Development Environment). I've chosen Code:Blocks a long time ago and I am still happy with it. Alternatively you can use NetBeans, Eclipse, DevCpp, ... There are a lot of IDEs for C or C++ available.


If on Mac/Linux, you can simply use make myprogram (in a terminal) to easily compile a single-file C program where the source file is called myprogram.c

For more complex programs with several source files, system dependencies et c, it quickly gets much more complex. Use google to find the basics of GCC, the default compiler on UNIX systems.


If you're on Windows, you could either use the Visual Studio from Microsoft (excellent, but not free) or Eclipse with CDT.

This provides you a full IDE with nice debugging support.

However, if you don't want to use an IDE but learn to build programs from scratch, cygwin would be an option including GCC and Make.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜