Borland or Turbo C/C++ can be a great development tool... if you want to study and create programs for legacy systems of the 1990's such as DOS. One of the most inconvenient features of using such tools, and most especially within source code developed, is the use of libraries that are incompatible with modern system (unless an emulator is used), most notably the use of conio.h, a C header file used in old MS-DOS compilers to create text user interfaces.
The programming construct inherit within the Borland/Turbo C/C++ compilers and libraries are not described in The C Programming Language book, and are not part of the C standard library (ISO/IEC 9899:1999 or ISO/IEC 9899:2011). Therefore, programs compiled with header files such as conio.h cannot be distributed to non-DOS systems or systems which do not conveniently provide an emulation of the DOS architecture.
However, if you want to learn how to develop production-quality applications and software, you must use development tools that are best suited for software development on and distribution to modern systems.
Compilers and Command-line Interface
As an alternative to using Turbo C/C++ or MSVC++ related integrated development environments, which can be costly depending on your needs, there are Free and Open Source tools that provide all the development functionality you'll need to learn and develop C/C++ applications for modern systems.
List of C Compilers
MinGW ("Minimalistic GNU for Windows")
A collection of freely available and freely distributable Windows specific header files and import libraries combined with GNU toolsets that allow one to produce native Windows programs that do not rely on any 3rd-party C runtime DLLs. Here, you'll find the fundamental development tools, including:
- gcc (C compiler)
- g++ (C++ compiler)
- fortran (Fortran 90/95 compiler)
- gpc (Pascal compiler)
- ada (Ada compiler)
- java (Java compiler)
- objc (Objective-C compiler) mingw32-make (GNU make) gdb (GNU debugger)
MSYS (Minimal SYStem)
A Bourne Shell command line interpreter system. It serves as an alternative to Microsoft's cmd.exe, providing a general purpose command line environment, which is particularly suited to use with MinGW, for porting of many Open Source applications to the MS-Windows platform.
Learn how to download and install the necessary packages needed for developing Windows applications with MinGW and MSYS:
Tiny C Compiler
A very small and very fast C compiler which is specialized to generate very small executables. Although it implements C90 standard and supports a few C99 features but is a very effective and efficient compiler.
It can be downloaded from:
LCC (Local C Compiler or Little C Compiler)
Another open source but not a free C compiler which can be used without any charge for personal use. For commercial use, you have to pay. It is retargetable and written in C. There comes an IDE for it too, called LCC-Win32.
It can be downloaded from here (the C-tutorial found here is a good resource too):
There would be many other compilers we may have missed out. I am attaching a list of sites I got by a google search for "list of c compilers":
Text Editors/Integrated Development Environments
We're confident that you know what a text editor is. If you're using Windows, chances are you've used Notepad often.
An Integrated or Interactive Development Environment (IDE) is software that provides a text editor for editing source code and tools for building, running, and debugging your programs.
For most IDE's, the functions of software compilation, execution, and source script interpretation are provided by separate applications that are installed on a system. For example, if you're compiling source code written in C using Code::Blocks, it will call a compiler (GCC for example) in the background to compile your program.
However, you don't really need an IDE to write and compile programs. You can write source code using virtually any text editor. Write your source code in a text editor, save it. Then open a terminal or command prompt, navigate to the location of your source code file, run the compiler on that file, and you now have a program!
(NOTE: Do not use word processors like MS Word, as they save your source code in weird formatting and not in plain text. Plain text editors are want you want).
A free C++ integrated development environment (IDE) built to meet the most demanding needs of its users. It is designed to be very extensible and fully configurable. A beneficial aspect to Code::Blocks is that it includes the GCC from MinGW.
Download Code:Blocks (codeblocks-10.05mingw-setup.exe)
This is a project that aims to continue the development of the Dev-C++ IDE. If you're still using version 22.214.171.124, it's time for an upgrade!
Geany is a text editor using the GTK2 toolkit with basic features of an integrated development environment. It was developed to provide a small and fast IDE, which has only a few dependencies from other packages. It supports many filetypes and has some nice features. Geany only requires the GTK2 runtime libraries.
Some basic features of Geany:
- Syntax highlighting
- Code folding
- Symbol name auto-completion
- Construct completion/snippets
- Auto-closing of XML and HTML tags
- Call tips
- Many supported filetypes including C, Java, PHP, HTML, Python, Perl, Pascal (full list)
- Symbol lists
- Code navigation
- Build system to compile and execute your code
- Simple project management
- Plugin interface (see Plugins)
Download Geany for Windows:
An extensible, customizable text editor. At its core is an interpreter for Emacs Lisp, a dialect of the Lisp programming language with extensions to support text editing.editing. But don't think it's just for Lisp programming. Emacs provides several features, including:
- Content-sensitive editing modes, including syntax coloring, for a variety of file types including plain text, source code, and HTML.
- Complete built-in documentation, including a tutorial for new users.
- Full Unicode support for nearly all human languages and their scripts.
Emacs is commonly found on Unix-like systems but can be installed and run various systems including Windows. It comes in both text and GUI. If you wish to use the text version, it's recommended
Download Emacs for Windows
A highly configurable, advanced text editor built to enable efficient text editing. It is an improved version of the vi editor distributed with most UNIX systems.
A CLI version of Vim is ported with MSYS:
GUI verson for Windows:
GNU nano is a small and friendly text editor. Besides basic text editing, nano offers many extra features like an interactive search and replace, go to line and column number, auto-indentation, feature toggles, internationalization support, and filename tab completion.
C Programming References
1. Beej's Guide to C Programming
This is probably one of the most informative and entertaining resources for learning C. Highly recommended.
2. Learn C The Hard Way
Don't let the title scare you (at least not too much ;) ).
3. The GNU C Programming Tutorial
4.The GNU C Library Reference Manual
Compiler Or IDE ?
it is becoming more and more common to mistake or confuse compilers and IDE's, hopefully the following links will help to educate and inform.