Thursday 16 February 2012

C++, a high level language


Any programming language like C, C++, SQL, Java etc,etc., are a set of instructions specially designed for computers to perform a specific task.

There are bassicaly 3 types of programming languages namely low level language, middle level language and high level language. Low level language is one which is machine friendly, means that this type of language is very close to machine in terms of understanding, interpretation etc and typical for user inturn. Middle level language is one which is ok.. to understand for both user/programmer and machine and high level language is one which is user friendly unlike low level language. C, C++ are two of the first high level languages.


Here in this site we are concentrating on C++ which is th 2nd high level language designed by making some modifications in 1st high level language that was C like by removing data insecurity and some of the other problems. It was developed by Bjarne Stroustrup in 1979 in AT&T Bell labs. It was actually named c because that time last designed programming language was B which was a middle level language. It is the most mportant language in  today's world to learn because it teaches one the basic programming techniques, rules etc, for being a good programmer.Now lets start:


Just a quick review of C++ programming:


Any program has to be formed by using some rules & regulations. First we have to include some header files which itself consists some big coding's/program's to perform several functions like how to print, how to take input from user in middle of the program etc..,given to a programmer for making their programs without defining each & everything to computer. These must be at the top because it helps the software to understand predefined functions going to be used in program.

Then comes the main body of the program consisting of a string main(). This is the indication that our main program has just started. The main program must be enclosed within parenthesis i.e { }.

Then some of the sub-programs to perform some common operations which are frequently to be used in program are designed.

Let's take a example program to understand C++ & its components:


#include<iostream.h>
void main()
{
  cout<<"HELLO";
}



The 1st line here is the header file.
2nd line indicates the main proghram has started followed by 3rd to 5th line which is our main body.

Since this is a small program which just prints HELLO, there is no sub-program.

No comments:

Post a Comment