Saturday 19 October 2013

Learn Programming in c++

# include<iostream>uisng namespace std;void main(){cout<<"I am JD"<<endl;}
here

# 

is used for the folder location(c++ compiler automatically known where headers files is)
include is used to inculde some header file in your program(we willl discuss later what is header file)
iostream is the header file.....
It is used for cin & cout etc etc.....
using namespace std;
Namespaces are like drawers in a filing cabinet. All of the standard library is in one drawer, and the only way to get to the stuff in that drawer is to tell C++ where to find it. You do that by prefixing the name with std,
std::cout is basically like saying "Hey C++! Look in  and get me cout, asap!". If you don't tell C++ which drawer to look in, it won't find what you want.
simply,this is used for declaring cin & cout ...
void main()
This is essential for any  c++ program(either it is console application or win32 application)
this is the starting point for any program,without this program the compiler cannot known where to start compling the program....
{
}
left and right braces are used for boundary line of your program...as in football there is a boundary so c and c++  has braces for that
cout
this is used for printing any thing in screen(only for console apps)
the thing which is in inverted commas can be printed..the compile cannot compile inverted commas inner side
this "<<" is,I mean is a operator to print anything on screen as operator for addition is + etc....
endl is used for having a one line space
Plz like my blog and feel free for suggestions

0 comments: