C Programming/What you need before you can learn

From Wikibooks, open books for an open world
< C Programming
Jump to: navigation, search
Previous: History Index Next: Using a Compiler

Getting Started[edit]

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.


Before you can start programming in C, you will need a C compiler. A compiler is a program that converts C code into executable machine code.[1]


Popular C compilers Include:

Name Website Platform License Details
OpenWatcom openwatcom DOS, Windows, Netware, OS/2 Open source
Borland C Compiler cppbuilder Windows Freeware
Microsoft Visual Studio Express Visual Studio Windows Free Version Lightweight, powerful, and student-friendly version of an industry standard compiler.
Tiny C Compiler (TCC) tinycc GNU/Linux, Windows LGPL Small, fast, newcomer-friendly compiler.
GNU C Compiler gcc GNU/Linux, MinGW(w32), Cygwin(w32), Mac OS X, Unix. GPL De facto standard. Ships with most Unix systems.


The minimum software requirements to program in C is a text editor, as opposed to a word processor. Windows Notepad can be used but it does not offer any advanced capabilities such as code completion or debugging. There are many text editors (see List of Text Editors), the most popular being vi, its clones (such as Vim), and Emacs, which are available for Windows, Linux and Mac OS X. Other popular notepad editors include Notepad++ (Windows) and jEdit (Java). A text editor with syntax highlighting is highly 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.

Though not absolutely needed, many programmers prefer and recommend using an Integrated development environment (IDE) instead of a text editor. An IDE is a suite of programs that developers need, combined into one convenient package, usually with a graphical user interface. These programs include a text editor, linker, project management and sometimes bundled with a compiler. 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 through it manually, or alter data as an aid to finding and correcting programming errors.

For beginners it is recommended not to use an IDE, since it hides most of what is going on. Using the command line builds up familiarity with the toolchain. An IDE may be useful to somebody with programming experience but knows how the IDE works. So as a general guideline: Do not use an IDE unless you know what the IDE does!


Popular IDEs Include:

Name Website Platform License Details
Eclipse CDT Eclipse Windows, Mac OS X, Linux Open source Eclipse IDE for C/C++ developement, a popular open source IDE.
Netbeans Netbeans Cross-platform CDDL and GPL 2.0 A Good comparable matured IDE to Eclipse.
Qt Creator Qt Creator Cross-platform GPL v3, LGPL v2 and commercial license An easy to use IDE for C, C++, Qt and others.
Anjuta Anjuta Linux GPL A GTK+2 IDE for the GNOME desktop environment.
Geany geany Cross-platform GPL A lightweight cross-platform GTK+ notepad based on Scintilla, with basic IDE features.
Little C Compiler (LCC) lcc Windows Free for non-commercial use Small open source compiler.
Xcode Xcode Mac OS X Free Available for free at Mac App Store.
Pelles C Pelles C Windows, Pocket PC Free A complete C development kit for Windows
Dev C++ Dev C++ Windows GPL Updated version is available as Orwell Dev-C++
Microsoft Visual Studio Express Visual C++ Windows Free Light weight, powerful, user friendly version of an industry standard compiler.
CodeLite CodeLite Cross-platform GPL 2 Free IDE for C/C++ development.
Code::Blocks Code::Blocks Cross-platform GPL 3.0 Built to meet users' most demanding needs. 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, the official release of Dev-C++ hasn't been updated since 22 February 2005.[2] An unofficial version of Dev-C++ is being actively developed however.[3] An alternate option for those working only in the Windows environment, Microsoft Visual Studio Express is the preferred method of learning and development.

On Mac OS X, the Xcode IDE provides the compilers needed to compile various source files. The newer versions do not not include the command line tools. They need to be downloaded via Xcode->Preferences->Downloads.

Footnotes[edit]

  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
  3. http://orwelldevcpp.blogspot.com/
Previous: History Index Next: Using a Compiler