What Is Computer Source Code?
Source Code in Visual Studio
A program is a set of instructions given to a computer to tell the computer what to do. Without these instructions, the computer is completely useless. Because computers can only understand instructions in the form of binary code (ones and zeros), there exists the need to translate human instructions into machine code (binary numbers). To do this, programmers write these instructions in a human readable form called source code. The image on the right is a sample of what source code would look like in the C++ programming language using Microsoft Visual Studio 2010 Professional. Click on it to enlarge the picture.
Once the source code is written and saved, it can then be converted (or compiled) into machine code. In the first stage of translation, the pre-processor seeks out special commands at the beginning of the file called pre-processor directives. These commands begin with the "#" symbol, and refer to what are called header files. The pre-processor translates these header files into source code, which can then be used to check the rest of the program for syntax errors.
Syntax errors are caused by the programmer incorrectly using the various elements of the source code. Once all of the source code is processed and translated into machine code, also called object code, it is saved into what they call an object file.
Three Types of Code
Finally, the last stage of translating the programmer's instructions into something that the machine can execute is performed by a program called the linker. The linker brings the object code and the C++ Programming language's runtime library code together, and saves the resulting executable code as an executable file. This is the full program file that can execute (or be run) on your computer. On the left, you’ll see a graphic simulating the three codes.
More by this Author
In this scenario we are asked to create a list of all the customers made inactive on a specific date. This should show enough details about the customer to allow contact with the customer, the reason he or she was made...
In all of programming, there are three basic activities that take place. These programming activities are input, process, and output. One of the many useful tools that programmers use to organize and visualize these...
Data consolidation and What-If Analysis are two completely different tools available in Excel 2010. However, there are situations in which these two tools may be used together. First, let’s...
No comments yet.