Assalam o Alykum
it's just a quick tutorial for every beginner who want to learn C,
i think @Hoorain ab tumy samaj aa jaye gie programming ki
don't waste time anymore 'my tea cup is finished now let's get started
first of all you have to know about C standard libraries or header files ..!
without including that, you can't even coding a bit in C or C++ .
Let's take a look at some important one.
*<iostream> : this one is stand for (input/output stream) and use to get input from user and give output message to users screen(it's use for C++)
<stdio.h> : stdio stand for (standard input/output) also use to get input and shows output message on screen. but it has some other more functions(see latter)
<cmath.h> : if you are gonna use math's function in your program then it's recomended to inlude cmath
<conio.h> : stand for (console input/output), also use to get input and shows output on screen ,but it has some built it functions(see latter)
<string.h> : use for string functions (very usefull)
<windows.h> : use for windows apps
There are alot more (Google it), but em not gonna cover everyone as beginner you will just face these one's ..!
*The syntax for including header files are
#include <header_file_name>
ok now let's take a look at <conio.h> and <stdio.h>.
#inlcude <conio.h> : it's use for getting input and showing input message on screen but it has some other built in functions like :
*clrscr() : stand for clear screen use to clear the contents of screen.
*getch() : stand for Get Character. The function use to get single character from user, your console will be paused untill you give any sngle character.
The character user entered can also stored in variable. e.g
ch = getch;
the console window will be paused until you give any character suppose you give (*) . the (*) character will saved in (ch) variable.
i don't want to give you more ass pain (Google it for more)
now come at stdio.h (standard input/output)
#iclude <sdtio.h> : it also contains different function that use in tha task of input and output
common functions:
*getchar(): This works similar as getch() works in conio.h header.
*putchar() : stand for Put Character use to display single character using stdio.h header.
*gets() :Stand for Get String use to get input from user.
Enough for header files or C standard libraries for more again google it
without wasting time let's make a simple hello world program, In addition i will put comments for every line. for your better understand..!!
let's get started :
To Be Continue ..!
it's just a quick tutorial for every beginner who want to learn C,
i think @Hoorain ab tumy samaj aa jaye gie programming ki
don't waste time anymore 'my tea cup is finished now let's get started
first of all you have to know about C standard libraries or header files ..!
without including that, you can't even coding a bit in C or C++ .
Let's take a look at some important one.
*<iostream> : this one is stand for (input/output stream) and use to get input from user and give output message to users screen(it's use for C++)
<stdio.h> : stdio stand for (standard input/output) also use to get input and shows output message on screen. but it has some other more functions(see latter)
<cmath.h> : if you are gonna use math's function in your program then it's recomended to inlude cmath
<conio.h> : stand for (console input/output), also use to get input and shows output on screen ,but it has some built it functions(see latter)
<string.h> : use for string functions (very usefull)
<windows.h> : use for windows apps
There are alot more (Google it), but em not gonna cover everyone as beginner you will just face these one's ..!
*The syntax for including header files are
#include <header_file_name>
ok now let's take a look at <conio.h> and <stdio.h>.
#inlcude <conio.h> : it's use for getting input and showing input message on screen but it has some other built in functions like :
*clrscr() : stand for clear screen use to clear the contents of screen.
*getch() : stand for Get Character. The function use to get single character from user, your console will be paused untill you give any sngle character.
The character user entered can also stored in variable. e.g
ch = getch;
the console window will be paused until you give any character suppose you give (*) . the (*) character will saved in (ch) variable.
i don't want to give you more ass pain (Google it for more)
now come at stdio.h (standard input/output)
#iclude <sdtio.h> : it also contains different function that use in tha task of input and output
common functions:
*getchar(): This works similar as getch() works in conio.h header.
*putchar() : stand for Put Character use to display single character using stdio.h header.
*gets() :Stand for Get String use to get input from user.
Enough for header files or C standard libraries for more again google it
without wasting time let's make a simple hello world program, In addition i will put comments for every line. for your better understand..!!
let's get started :
Code:
#include <stdio.h> //header file for input output
main(){ //main fucntion starts
//within these brackets {} << we can wirte our execution code
printf("Hello world"); //printf function use to get output message show on screen
getchar(); //this will puase your console window untill you press any character
//without getchar() function your program will run so fast try running your program without getchar()
//semi colon(;) are recomended in c language after any command
}// main fucntion ends
To Be Continue ..!