C Programming/What you need before you can learn
The goal of this book is to introduce you to and teach you the C programming language. Basic computer literacy is assumed, but no special knowledge is needed.
Popular C compilers/IDEs include:
|Microsoft Visual Studio Express||Visual Studio||Windows||Proprietary, free of charge||Powerful and student-friendly version of an industry standard compiler.|
|Tiny C Compiler (TCC)||tinycc||GNU/Linux, Windows||LGPL||Small, fast and simple compiler.|
|Clang||clang||GNU/Linux, Windows, Unix, OS X||University of Illinois/NCSA License||A free, permissively licensed front-end using a LLVM backend.|
|GNU C Compiler||gcc||GNU/Linux, MinGW or mingw-w64 (Windows), Unix, OS X.||GPL||The 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. A plain text Notepad editor can be used but it does not offer any advanced capabilities such as syntax highlighting and code completion. There are many text editors (see List of Text Editors), among the most popular are Notepad++ for Windows as well as Atom, Sublime Text, gedit, Vim and Emacs which are also available on other operating systems (“cross-platform”). These text editors come with syntax highlighting and line numbers, which makes code easier to read at a glance, and to spot syntax errors.
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 and file browser and are sometimes bundled with an easily accessible compiler. They also typically include a debugger, a tool that will enable you to do such things as step through the program you develop manually one source code line at a time, or alter data as an aid to finding and correcting programming errors.
Many IDEs do not offer their users a console-based interface to the compiler and for executing the developed program but offer only graphical buttons. For beginners it is recommended not to use such an IDE, since it hides most of what is going on. Using the command line builds up familiarity with the toolchain. Such an IDE may still be useful to somebody with programming experience who knows how the IDE works. So as a general guideline: Do not use an IDE unless you know what the IDE does!
Other popular compilers/IDEs include:
|Eclipse CDT||Eclipse||Windows, Mac OS X, GNU/Linux||Free/Libre and 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.|
|GNOME Builder||Builder||GNU/Linux||GPL||A feature-rich but simple IDE for the GNOME desktop environment.|
|Anjuta||Anjuta||GNU/Linux||GPL||An extensible GTK+3 IDE for the GNOME desktop environment.|
|Geany||geany||Cross-platform||GPL||A lightweight cross-platform GTK+ notepad based on Scintilla, with basic IDE features.|
|KDevelop||KDevelop||Cross-platform||GPL||A cross-platform IDE for the KDE project.|
|Little C Compiler (LCC)||lcc||Windows||Open Source but not Libre||Small open source compiler.|
|Xcode||Xcode||Mac OS X||Proprietary, free of charge||Available free of charge at Mac App Store.|
|Pelles C||Pelles C||Windows, Pocket PC||Proprietary, free of charge||A complete C development kit for Windows.|
|Dev-C++||Dev C++||Windows||GPL||Updated version of the formerly popular Bloodshed Dev-C++.|
|Microsoft Visual Studio Express||Visual Studio||Windows||Proprietary, free of charge||Microsoft’s compiler already mentioned above comes bundled with an IDE.|
|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 by default.
On Microsoft Windows, Dev-C++ is recommended for beginners because it is easy to use, free, and simple to install. Although the initial developer (Bloodshed) hasn’t updated it since 2005, a new version appeared in 2011, made by an independent programmer, and is being actively developed. An alternate option for those working only in the Windows environment is the proprietary Microsoft Visual Studio Express which is free of charge and has an excellent debugger.
On Mac OS X, the Xcode IDE provides the compilers needed to compile various source files. The newer versions do not include the command line tools. They need to be downloaded via Xcode->Preferences->Downloads.
- 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), which is not to be confused with c++ (a compiler for another programming language).