The source code that programmers write in C++ is not what computers actually read when they execute their programs. What computers actually read is a much more complex code called machine code or machine language: step-by-step directions for a processor. Programmers can write programs in this language, but it is very time consuming and much more difficult to code complex programs. A program called a C++ compiler translates C++ source code into the machine code that constitutes an executable program.
C++ programmers can use a simple text editor to create the source code files for very simple programs, but an integrated development environment, or IDE, makes it easier to create more sophisticated programs that span several source code files and multiple libraries. A few basic computer concepts can help new C++ developers understand how to program and how to use IDEs like C++ Builder, the successor to Turbo C++.
Source Code vs. Machine Code
Compiler vs. IDE
The Turbo C++ IDE has a built-in function for sending the current project's source code through the C++ compiler for translation into machine code. This kind of integration can lead novice programmers to believe that the IDE and the compiler are one and the same. This is not the case. The IDE is a program that helps programmers manage and write source code, while the compiler is a separate piece of software. Turbo C++ installs a compiler in addition to the main program, and the IDE is pre-configured to directly access the compiler.
While users are accustomed to navigating to files by clicking on a series of folders, this is just a graphical representation of an operating system's underlying directory structure. A folder's directory address starts with the operating system's root folder, which is "/" for Unix based systems and usually "C:" for the Windows operating system. Every folder on a system lies within this root directory, and subsequent folders or files are separated by a "/" for Unix based systems or "\" for Windows systems. For example, "C:\Program Files" is the directory address for Window's "Program Files" folder. When programmers reference a file in C++ code, they need to use its directory address in this format.
All modern operating systems have graphical user interfaces, which are much easier for everyday users to navigate than the command line interfaces that characterized early operating systems. Operating systems do, however, maintain programs that emulate these interfaces for advanced users. C++'s standard library includes commands that allow programs to run in these command lines, which are sometimes called terminals. Writing programs to run in graphical interfaces requires additional libraries and additional knowledge, so beginning C++ programmers will be writing programs that execute in a terminal or command line.
- Photo Credit Stockbyte/Stockbyte/Getty Images