1st Tutorial

Basics

Header Files :

There are several header files. #include<iostream> is input output stream header files in which cout & cin functions are stored.I will discuss about more header files in my tutorials like #include<conio.h>, #include<math.h> etc.

# means pre-process (process before compilation) headerfiles are always write on the top.

Namespace std:

We write "using namespace std;" to tells the compiler to use standard namespace.if you not write this after headerfiles then you will write it before every cout functions or some else.This saves our time if we write it after headerfiles. 

Cout:

cout is a function to display something on the black screen after debugging.syntax is cout<<"Your Message"; Every thing in inverted commas be shown on black screen.if you just missed a ; there will be error.Variables will be discussed in our next lecture.

Return 0:

Return 0; terminates the main() function and causes it to return the value 0 to the calling process.we will be discussed it in detail when i will upload a tutoial on Functions.


A simple code to  display a Message

#include<iostream>
#include<conio.h>
using namespace std;
int main()
{
cout<<"Hello World";
 getch();
return 0;
}

Output:
Hello World

Note:
If you use Dev C++ there is not necessery to include headerfile of conio.h and you don't need to use getch();
I will discuss about it in my 1st tutorial on YouTube.

Comments

  1. This comment has been removed by a blog administrator.

    ReplyDelete

Post a Comment

Popular posts from this blog

HSSPhilpines

Donald Trump Quotes