Tuesday, August 2, 2011

::::|| VU ||:::: Re: ||| VuHelp4U ||| ************Learnc C++ lecure 08*************************

and all lec are available on following link

http://vuscool.com/study-discussion/

On Tue, Aug 2, 2011 at 6:00 PM, And-or-Logic <bc100400662asad@gmail.com> wrote:
Aslamo alikum to every member.

main ney iss sey pehly 7 lectures post kar diy they lekin time na hony ki wja sey iss ko continue nahi kar saka tha. 
exam k bad dobara continue karny ka program bna to mery tabiyat ny sath na diya. ab mai kush theek hoo aor aaj sy inshallah baqaida sey lectures ka agaaz kar raha hoo. app sub sey dilly request hai k mery ley dua zaroor kar dejey k Allah mujy asey sehat aata kary k jiss k bad koi bemari baqi na rahy. regards and thanks
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Today we will discuss about 
1.Functions.
 

what is the concept of a function:
Functions ko discuss karny sey pehly mai iss ko aik simple tareeqy sey shuru karna chaho ga. hum loog chahty ya nachahty howey bi aik dosry insaano per depend karty hain. 
maslan agr koi teacher hai to us ka kaam teach karna hai issi tarha former ka aik apns specific kaam hai.aor car-motor mechanic ka apna kaam hai. 
agr hum apny ird gird nigah daly to humey you maloom ho ga jesy hum main sey har aik aik khass qisam k kam per mamoor hai. 
aor iss khass kam k karny ki routine ko hum programming language mai function kehty hain. lehaza hum mai sey har aik atleast
aik function zaroor perform kar raha hai. 

ab aey issi tswr ko C programming mai implement kar k functions ko samney ki koshish karty hain k programming word mai functions kiss ko kiya kehty hain
in ka kiya role hai aor kiyon zaroori hain. 
Farz kary app k pass aik byke hai jiss ki app monthly service k ley iss ko mechanics k pass ley jaty hain. mechanic iss ko app sey pouchy begar hi 
iss ki service shuru kar deta hai kiyon k us ko pta hai k iss k kiss kiss hissy ko chk karna hai aor kiya kiya cheez repair karny hai. 
har inssan har kaam khud karny sey qasir hai jiss k ley us ko apni hi tarha k insaan sey help ki zaroort parti hai. 
Functions in C programming:
C programming mai jab hum prograam likh rahy hoty hain to agr us program ko aik tairana look sey dekhy to bzaahir iss programm k bi boht sey hisary
aor kai fields hoty hain. ya jab bi hum koi programm shuru karty hain to hum apny toor per program ko different size aor differnt hisso per devide kar lety hain .
in hisso jin ko partiations karna kehty hain k hissay aik khass tarteeb aor andaz sey iss tarha kiy jaty hain k har aik hissay ka apna specific kaam hoo
jiss ko perform karna us ki duty hoo. 
phir in parts ko aik aik kar k hum C language mai coding karna shuru karty hain aor at the end hmra sara program bun jata hai. 
aor wo parts jin ko hum alehda sey devide kar k implement karty hain in ko functions kehty hain. 
why functions are too important:
funtions ka feture inta powerfull hai k yeh har programming language mai shamil hai java mai iss ko method aor windows programming mai iss ko messages kehty hain. 
functions kissi bi languge ka lazmi hisa iss ley hoty hain k yeh program ki over all managment k ley aik read ki hasiyat rakhty hain. 
agr hum kissi bi aik programm ko start sey solve karna shuru kar dey to sara programm likhty likhty thak jay gay aor us ki koi samj nahi aye ki k program ka flow kaha sey kiss tarf
ja raha hai.iss ley agr hum function level approuch ko use kary to kissi dosry ko hmary program ki bi samj aye gi khud develper k ley program ki logic ko reuse karna bi easy ho jaye ga.

iss technique ko "stepwize top-down approuch" kehty hain. 
yani sary k sary program ko stepwize top sey down tak choty choty hiso mai devide kar k phir solve karna. 

Types of functions:
1.aesy function jo input nahi lety lekin output dety hain. 
2.aesy function jo input lety hain lekin output nahi dety
3.asey function jo input lety hain aor output dety hain
3.asey function jo na input lety hain aor na hi output dety hain

in sub ko detail mai dekhty hain nechy lekin us sey pehly aik bat jo zaroori hai wo yeh k hum function k sath kiya kiya 
kr sakty hain. 
app duniya mai koi bi language per kam kar ley yad rakhy k function k sath app 3 qisam k ilawa koi aor slooq nahi kar sakty 

wo yeh hain 

action on function:
1.function can be define/implement
2.function can be prototyped.
3.cunction can be call.
Generat syntax of a function:

function ka general syntax iss tarha hota hai

returntype  functionname (prameter list using comma seprated.);
for example
char tell_your_Name ( char Name);
iss mai function ki return type char
iss mai function ka name tell_your_Name
iss mai function ki prameter list ya input aik char type ka variable hai. 
function prototype sey kiya murad hai:
prototype sey murad hai k pehly sey btana yani jo function hum ney apny program k ley bna na hai us function k mutalaq hum 
program k start mai hi bta dety hain k iss function ko hum apny program mai istamal karna chahty hain. 
iss aml ko prototyping kehty hain. 
prototype mai function ka naame return type aor argument type deny zaroori hoti hai. 
for example

void myfunc(int,char,float);
yeh function bta raha hai k iss ki return type void yani koi bi output nahi ho gai jab k input mai yeh
3 different type k variables jin ki data type biltartreeb int,char aor float hai wo ley ga. 
or end per semicolon lazmi aye ga.

function defination aor implimentation sey kiya murad hai:
function defination ya implimentation function ka asl hisa hai jiss mai hum yeh cheez teh karty hain k humara function kissi
aik khass problem ko kiss tarha solve kary ga.function implementation ko function ki body bi kehty hain.
for example

int add(int x, int y)
{
line of code;
defination mai prameter list mai variables ki type k sath name bi dena zaroori hai jab k prototype mai name na bi diya jay to bi theek hai.

function call sey kiya murad hai:
jab hum apna program likh rahy hoty hain to iss waqt agr hum ko koi asey code ki zaroort par jay k jiss ko hum ney function mai likha howa hai to 
us function ko call karna parta hai jiss ka tareeqa yeh hai 

function name(parameter);
yani jo function hum ney use karna hai us ka name aor breckts mai prameters likhny hain aor end per semi colon 

iss ka next part kal tak inshallah post kar diya jay ga app iss ko achi tarha sey yad karly

pls dua for me
 















--

Take your soul out of the way from cheristanity 
Asad Ali
Senior Embedded Developer at (Code Guru)

BSc (Semester-02) 

City.Gujranwala


--
You received this message because you are subscribed to the Google
Groups "vuhelp4u" group.
To post to this group, send email to vuhelp_pk@googlegroups.com
To unsubscribe from this group, send email to
vuhelp_pk+unsubscribe@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/vuhelp_pk?hl=en?hl=en
 
Group Rules Vuhelp4u
1- Sharing of Video songs links, movies links, dramas links are not allowed in study group. Only Islamic and general information Video links allowed.
2- Phone no. sharing is not allowed in the group.
3- SPAM, Advertisement, and Adult messages are NOT allowed and that member will be behaved strictly.



--

 

لذّت کی وجہ سے گناہ مت کرو کیوں کہ لذّت ختم ہو جاۓ گی پر گناہ باقی رہ جاۓ گا

اور مشقت کی وجہ سے نیکی مت چھوڑو کیوں کہ مشقت ختم ہو جاۓ گی پر نیکی باقی رہ جاۓ گی


             
               <<<<<<< sAd pAncHi >>>>>>> 


--
For study materials, past papers and assignments,
Join VU School at www.VusCool.com
and www.VUGuys.com
CoooL Virtual University Students Google Group.
To post to this group, send email to coool_vu_students@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/coool_vu_students?hl=en

No comments:

Post a Comment