Headlines News :
Home » , » What is c++

What is c++

Written By Durgesh on Wednesday 29 February 2012 | 13:02

 This is first posts on c++ in this we know what is c++ and how its work
 C++ is a programming language--it will allow you to control your computer, making it do what you want it to do. This programming tutorial series is all about helping you take advantage of C++.
 But how does a program actually start? Every program in C++ has one function, always named main, that is always called when your program first executes. From main, mean that first all that codes will execute that is in main function  , you can also call other functions whether they are written by us
 Let's look at a working program:


#include <iostream.h> 
 
Void main()//*calling main function
{ 
 cout<<"HEY, you, I'm alive! Oh, and Hello World!\n";

}

Let's look at the elements of the program. The #include is a "preprocessor" directive that tells the compiler to put code from the header called iostream is header file  By including header files, we  can  access to many different functions. For example, the cout function requires iostream. F
The next important line is void main(). This line tells the compiler that there is a function named main. The "curly braces" ({ and }) signal the beginning and end of functions and other code blocks. You can think of them as meaning BEGIN and END.

The next line of the program may seem strange. you might expect that print would be the function used to display text. In C++,  the cout object is used to display text (pronounced "C out"). It uses the << symbols, known as "insertion operators", to indicate what to output. cout<< results in a function call with the ensuing text as an argument to the function. The quotes tell the compiler that you want to output the literal string as-is. The '\n' sequence is actually treated as a single character that stands for a newline (we'll talk about this later in more detail). It moves the cursor on your screen to the next line. Again, notice the semicolon: it is added onto the end of most lines, such as function calls, in C++.
reaching the end of main, we  close brac.

Share this article :

No comments:

Post a Comment

 
Support : Creating Website | Johny Template | Mas Template
Copyright © 2011. Tutorial of Programing - All Rights Reserved
Template Modify by Creating Website
Proudly powered by Blogger