C Programming/What you need before you can learn

From Wikibooks, the open-content textbooks collection

Jump to: navigation, search
Previous: History Index Next: Using a Compiler

[edit] Getting Started

The goal of this book is to introduce you to the C programming language. Basic computer literacy is assumed, but no special knowledge is needed.

The minimum software requirements to program in C is a text editor, as opposed to a word processor. There are many text editors (see List of Text Editors), the most popular being vi, its clones (such as Vim), and Emacs. A text editor with syntax highlighting is recommended, as it can make code easier to read at a glance. Highlighting can also make it easy to spot syntax errors. Most programmers' text editors on Windows and Unix systems can do this.

If you choose to use a text editor, you will be required to have a C compiler. A compiler is a program that converts C code into executable machine code. [1]


Popular C compilers Include:

Platform License Extra
OpenWatcom [1] DOS, Windows, Netware, OS/2 Open source
Borland C Compiler [2] Windows Freeware
Microsoft Visual Studio Express [3] Windows Freeware light weight, powerful, and student friendly version of industry standard compiler
Tiny C Compiler (TCC) [4] GNU/Linux, Windows LGPL Small, fast, newcomer-friendly compiler.
GNU C Compiler [5] DOS, Cygwin (w32), MinGW (w32), OS/2, Mac OS X, Unix, GPL De facto standard. Ships with most Unix systems.


Though not absolutely needed, many programmers both prefer and recommend using an Integrated development environment (IDE) over a text editor and compiler. An IDE is a program that combines a set of programs that developers need into one convenient package, usually with a graphical user interface. These programs include a compiler, linker, and text editor. They also typically include a debugger, a tool that will preserve your C source code after compilation and enable you to do such things as step manually through it or alter data in an attempt to uncover errors.


Popular IDEs Include:

Platform License Extra
CDT [6] Windows, Mac OS X, Unix Open source A C/C++ plug-in for Eclipse, a popular open source IDE.
Anjuta [7] Unix GPL A GTK+2 IDE for the GNOME desktop environment
Little C Compiler (LCC) [8] Windows Free for non-commercial use.
Xcode [9] Mac OS X Free Available on the "Developer Tools" disc with most recent-model Apple computers, or as download when registered (free) at Apple Developer Connection.
Pelles C [10] Windows, Pocket PC "free"
Dev C++ [11] Windows, Linux (alpha version only) GPL
Emacs [12] Windows, Mac OS X, Unix GPL Powerful programmable editor. Both graphic and text use. Does everything you need. Information for MS Windows.
Microsoft Visual Studio Express [13] Windows Free light weight, powerful, and student friendly version of industry standard compiler
Code::Blocks [14] Windows, Linux, Mac OS X GPL 3.0 Built to meet the most demanding needs of its users, it is designed to be very extensible and fully configurable.

On GNU/LINUX, GCC is almost always included automatically.

On Microsoft Windows, Dev-C++ is recommended for beginners because it is easy to use, free, and simple to install. However, Dev-C++ hasn't updated since February 22 2005.[2]

On Mac OS X, the Xcode IDE provides the compilers needed to compile various source files. Installing Xcode installs both the command-line compilers as well as the graphical IDE.

[edit] Footnotes

  1. Actually, GCC's(GNU C Compiler) cc (C Compiler) translates the input .c file to the target cpu's assembly, output is written to an .s file. Then as (assembler) generates a machine code file from the .s file. Pre-processing is done by another sub-program cpp (C PreProcessor).
  2. http://sourceforge.net/news/?group_id=10639
Previous: History Index Next: Using a Compiler
In other languages