This is the second tutorial of Series Learn Basic C and in this we are discussing about the structure of the C program.
In this I am going to tell you the things you need to remember and follow while writing any C program.
As we will be using Dev C++ , If you don't have you can check my previous post or my video.
So the thing that came in our mind is what is Structure of a C program what things we need to write if we want to write our own C program So this is the very basic tutorial and must for everyone.
So here we first Study about the Pre processor directives so how I explain the Pre Processor directives is quite bit enjoying and relating our common English.
So first understand the meaning of Pre is something which is before.
then processor we can say that it's some machine which process or do our tasks.
& directive means official instruction.
So, if we relate all this to our programming then what we get is that these are the instruction which our compiler preform before executing any of our code.
What it does is it includes all our required files and pre defined function which we are using in our Program.
One thing which we need to keep in our mind is that we need to write "#" in the very beginning of our Pre Processor line.
Good Bye have a nice moment.
In this I am going to tell you the things you need to remember and follow while writing any C program.
As we will be using Dev C++ , If you don't have you can check my previous post or my video.
So the thing that came in our mind is what is Structure of a C program what things we need to write if we want to write our own C program So this is the very basic tutorial and must for everyone.
So here we first Study about the Pre processor directives so how I explain the Pre Processor directives is quite bit enjoying and relating our common English.
Pre processor
So first understand the meaning of Pre is something which is before.
then processor we can say that it's some machine which process or do our tasks.
& directive means official instruction.
So, if we relate all this to our programming then what we get is that these are the instruction which our compiler preform before executing any of our code.
What it does is it includes all our required files and pre defined function which we are using in our Program.
One thing which we need to keep in our mind is that we need to write "#" in the very beginning of our Pre Processor line.
Global Declaration
"Global" means "relating to the whole world; worldwide." and "Declaration" means "Formal statement or announcement".
Now, relating this to programming we get that these are announcement which is acceptable in whole program. Here announcement means either declaring variable or some function declaration.
Scope of these variables is whole program and these are defined very after including header files to program.
Scope of these variables is whole program and these are defined very after including header files to program.
Program used as example in video.
#include<stdio.h>
//preprocessor directives
int a; //Global Variables
int main() //Main Function
{
printf("I'm A New Programmer"); //Printing on the Screen.
}
Here I want to specify one more thing that's comment the portion written in green are called comments. What are comments?
Comments are something which we write for our memory and that we not want our compiler to read them and execute them. Comments can be single or multiline.
Single line comment which completes in one line, the one which are used in the above program.
For converting the statement to comment or to write one we need to specify //.
Multiline comment which are of more than one lines, and for writing them we use
/*
this is a multiline comments.
*/
Here I want to specify one more thing that's comment the portion written in green are called comments. What are comments?
Comments are something which we write for our memory and that we not want our compiler to read them and execute them. Comments can be single or multiline.
Single line comment which completes in one line, the one which are used in the above program.
For converting the statement to comment or to write one we need to specify //.
Multiline comment which are of more than one lines, and for writing them we use
/*
this is a multiline comments.
*/
Video tutorial in hindi.
Video tutorial in English
Releasing soon.
No comments:
Post a Comment