Pages

Monday, November 19, 2012

Getting Started With C and C++


Welcome to this blog which is about C and C++ programming language. This blog will discuss about the popular C and C++ programming language from beginning to professional level. Visiting step by step through this blog, you will able to know how to create professional software with this high-level language. So, no more talking but before starting, you need to be familiar with the background of C and C++ programming language. Below section will show the history and the necessary discussion before starting C and C++ language.

Programming Language 

Language is used to communicate with each other. But programming language is specially used for computer to communicate with its user. As computer understands nothing except 0 and 1, its user should build an instruction set which is combination with 0 and 1 named as machine language. So a compiler is necessary to interpret user’s symbolic word to computer readable instruction set. As a demand, programming language comes out.
From the above discussion, Programming Language is defined as an instruction set, word or code which is readable to the computer and used to solve any practical problem by the computer.

Types of programming language

Programming languages are divided into two types…
  •  Low-level language: This is directly readable by the computer. Such as machine language and assembly language.
  • High-level language: An interpreter is necessary for these languages to translate human readable code to machine readable code. C, C++, lava, C#, Visual Basic etc are the example of high-level language.
  What are C and C++?
  • C which was created by Dennis Ritchie at Bell Laboratories at 1972 is one of the most popular high-level  computer languages. It is treated as a God language of computer programming.
  •  C++, an extension of C, was developed by Bjarne Stroustrup in the early 1980s to overcome the limitation of C. C++ contains all the functionality of C language with some extra features including object-oriented capabilities discussed later in details in this blog. Today, most of the general-purpose operating system like windows is written in C or C++ language.         
Advantages of C and C++ language
  •   Easy to learn than other high-level programming language.
  •    Platform independent language.
  •   Easy to control both hardware and software.
  •     Both modular and object-oriented programming capability.
  •    Operating system programming capability.
  •   Capable of programming both microcontroller and microprocessors.
  •    The best hardware friendly programming language.
  •    More Speedy.
For the above functionalists, C and C++ are the most popular modern language.

Programmer view on C and C++

There are a lot of computer programming languages. All of these, C/C++ provides easy syntax and functionality. So, at the beginning most of the programmers suggest to start with C and C++ programming. I also started my programming concept with this language and it is one of my favorite languages. I think you are lucky if it is your starting point in programming language.   
 
Prerequisites to learn C and C++
  • Educational Quality: No specific certificate is necessary. Anyone who is eligible to read this tutorial is able to learn C and C++.
  •  Operating System Quality: Some basic knowledge about windows operating is suggested but not so necessary for this tutorial. Playing with C and C++ anyone can be familiar with the operating system. 
  • Necessary Software: A C++ compiler and an IDE (Integrated Development Environment) are strongly necessary. There are a lot of IDEs to edit and compile program but among these we will use a Turbo C++ 4.0 for windows operating system. Download Turbo C++ 4.0 or 4.5 and start coding.
Now you are ready to start first program in C and C++ programming. Open your IDE (Turbo C++ 4.0) and create a new file named first.cpp. Every C and C++ should have .cpp extension to indicate that it is a C and C++ file. Do the following code and run the program with Ctrl+F9 key or Run> Run. If everything is OK, you will get the below output.

First program in C and C++

#include<stdio.h>
#include<conio.h>

void main()
{
 clrscr();
 printf("Welcome to C and C++ programming.");
 getch();
}


Program Output