12/06/2015

Introduction To C++ Language

C++ Language Introduction

C++ is a middle level language. It is develop by Bjarne Stroustrup in 1979 at Bell Lab. It can be run on different platforms, like UNIX, Window, Mac. C++ program is a collection of commands. Commands are either function or keywords.
 

The first thing which you need to do is to make sure that you have a compiler. A compiler turns the program into an executable file that your computer can understand. In this tutorial we will use Code Block comiler, which you can download by clicking at the following link.
                
                             Click Here To Download Code::Block

After installing the following window will appear.


Now, let's make our first program.

#include
 int main() 
std::cout << "Hello World!";
 }


Line 1:
The first line #include with # is directives. The directive instructs
the preprocessor to include a section of C++ code and known as header.

Line 2:
Blank lines and white-space has no effect on program.


Line3:
This line tells the compiler that there is function name as main and that function return an interger. The curly braces {} tells the compiler the beginning and end.

Line 5:
The << symbol known as insertion operator, that follows is inserted into std::cout . std::cout identifies the standard character output. Finally ("Hello world!") is the content inserted into std::cout. The statement end with a semicolon ; .

We can write the above code into signal line a well, as shown below.


int main () { std::cout << "Hello World!"; }
 
Next, we will learn about variable, constant and operator. 

2 comments:

Interfacing LCD With Arduino Microcontroller

In this tutorial we are going to  interface a  Liquid Crystal Display (LCD)  with Arduino Microcontroller .  Liquid Crystal Display are us...