How to Program in C++
Level of difficulty: Easy
C++ is a programming language said to be object-oriented. It was created by Bjarne Stroustrup and puts into effect “data abstraction” through a concept called “classes”. This programming language is used in a number of software applications, device drivers, high performance servers, entertainment software, and embedded software. The C++ programming language was designed as a general purpose language and is capable of functioning even without a sophisticated programming environment. It is cable of supporting multiple programming styles such as procedural programming, object-oriented programming, generic programming, and data abstraction.
Materials Needed:- C++ Integrated Development Environment (IDE)
- Book or Reference Manual on C+++ Programming Language
Step 1
Install the C++ Integrated Development Environment (IDE). The program can be downloaded for free from Bloodshet.net. Once installed, launch the program and create a project. Make sure that you add a C++ source file to the project created before saving the work.
Step 2
Codes will then be inserted into the source file by copying and pasting the following codes: 0x00#include < stdlib.h >; 0x01#include < iostream >; 0x02; 0x03using namespace std; 0x04; 0x05int main() {; 0x06; 0x07 cout << 'Hello world.' << endl; 0x08; 0x09 system('PAUSE'); 0x0A return 0 and 0x0B}. In copying the codes, make sure that the hexadecimal numbers (0xXXX) on the first four columns of every row are excluded. These codes will then be used as reference points for the succeeding steps.
Step 3
The lines 0x00 and 0x01 append to the program two library files through the 'include' preprocessor directive. The 'stdlib.h' plays a contributory role for freezing the console for Borland C++ Builder.
Step 4
Know what 0x03 means. The line informs the compiler that the program utilizes a group of functionalities from the namespace 'std'. The namespace is utilized for grouping different functions under one group to ensure that no name duplication and ambiguity are experienced.
Step 5
The lines 0x05, 0x0A and 0x0B refer to the 'main()' function, a common feature of every C++ program. The space used to brace the 'main()' function is the execution space of the program. The sequence for executing the program is usually from right to left and from top to bottom. When the 'main()' function returns to a zero integer, the execution of the program is successful.
Step 6
Understand the meaning of 0x07 which represents the 'Hello world' program. Line 0x07 reads as 'Transfer the following data stream to the console'.
Step 7
The user must then compile the program and launche it. Once launched, the user will receive a message on the DOS console stating 'Hello world'.