* ANATOMY OF A C++ PROGRAM *
#include<iostream> /* #include directive -preprocessor directive- */ using namespace std; /* namespace /* int main (void) /* main functionn */ |
MAIN FUNCTION | group of related instructions, also called statements which together perform a particular task. |
FUNCTION BODY | each of the related instructions or statements which belong to the main function are contained with in the body. |
COUT | refers to the directions in which cout sends a stream of data. |
RETURN 0 STATEMENT | tells the operating system that the program ended normally. |
# INCLUDE DIRECTIVE | called “preprocessor directive” to start at the main function. |
NAMESPACE | c++ uses namespaces to organize different names used in programs. |
COMPUTER PROGRAM – a step-by-step instruction written by a computer programmer.
PROGRAMMING LANGUAGE – automate instructions; are program language can cover many machine language instructions.
* 3 programs used to translate your sourcecode into an executable file that computer can run*
1. PREPROCESSOR – a program that scans the sourcecode for preprocessor directive such as include directives.
2. COMPILER – another program that translates the preprocessor sourcecode into corresponding machine language instructions
which are stored in a separate file, called an object file having an obj. extension.
3. LINKER – uses runtime library or the ability to interact with external hardware.
Recent Comments