हिंदी माध्यम नोट्स
C99 – Feature (Part -3) : function related modification in c language in hindi , फंक्शन सम्बंधित मॉडिफिकेशन
C 99 मे function को implement करके के तरीके मे काफी changes आये है |इसमें include होता है :-
1.Default of int rule को हटा दिया गया है |
2.Implicit function declaration को भी हटा दिया गया है |
3.return function की complusy को भी हटा दिया गया है |
4. function inline facility1. Elimination of Default of int rule
.जब किसी function को declare किया जाता है |इसका syntax होता है :
return type function name (parameter details);
इस syntax मे :
return type : ये declare करता है की function से किसी प्रकार के data type return होगा |
function name : ये function का नाम है|
parameter details: ये सेक्शन मे function मे pass होने वाले variable के data type को declare किया जाता है |
C language मे , अगर return type को declare नहीं करते है तब इसका default return type integer होगा | जैसे
#include<stdio.h>
#include<conio.h>
add(int , int );
void main()
{
int a ,b,c;
printf(“Data”);
scnaf(“%d %d”,&a &b);
c=add(a,b);
printf(“Sum = %d”, c);
getch ();
}
add (int e,int f)
{
int sum;
sum=e+f;
return(sum);
}
इस उदाहरण मे , function add() के declaration मे return type को declare नहीं किया गया है |add() function से integer return हो रही |और function का default return type integer type है अतः ये प्रोग्राम बिना किसी error के run हो जाता है |
लेकिन अगर इस function को C99 मे run करे तो error आ जाती है |इस error को दूर करने के लिए function के declaration मे return type को int से declare करना पड़ता है |अतः
प्रोग्राम :- C99
#include<stdio.h>
#include<conio.h>
int add(int , int );
void main()
{
int a ,b,c;
printf(“Data”);
scnaf(“%d %d”,&a &b);
c=add(a,b);
printf(“Sum = %d”, c);
getch ();
}
int add (int e,int f)
{
int sum;
sum=e+f;
return(sum);
}
इसके अलावा default integer का rule function parameter मे भी omit कर दिया गया है |क्योकि अगर किसी function parameter को function declaration मे उसके qualifier से declare किया जाता है |तब उस parameter का default type integer होता है |c language मे usually तीन qualifier मुख्य होते है |
1.Constant: ये भी एक नार्मल variable ही होते है लेकिन इनके value constant होती है यानि change नहीं हो सकती है |इसका syntax const होता है |
2.Register : ये भी नार्मल variable होते है लेकिन ये memory मे store नहीं होते है बल्की कंप्यूटर memory बने register मे store होते है |इसका syntax register होता है |
3.volatile: जब किसी variable को volatile declare किया जाता है तब इसकी value को प्रोग्राम मे change नहीं कर सकते है | इसे केवल सिस्टम से change हो सकता है |
उदाहरण के लिए :-
C language मे ,
#include<stdio.h>
#include<conio.h>
int mul( );
void main()
{
int c,a,b;
printf(“Data”);
scnaf(“%d %d”,&a &b);
c=mul(a,b);
printf(“Multiplication = %d”, c);
getch ();
}
mul ( register e, register f)
{
int mul;
mul =e*f;
return(mul);
}
इस उदहारण मे , function definition मे variable को register declare किया गया है अतः इसका default type integer भी है लेकिन ये function C99 मे run हो सकता है |
इसके लिए निन्म modification करना पड़ता है :-
C99 language मे ,
#include<stdio.h>
#include<conio.h>
int mul( );
void main()
{
int c,a,b;
printf(“Data”);
scnaf(“%d %d”,&a &b);
c=mul(a,b);
printf(“Multiplication = %d”, c);
getch ();
}
mul ( register int e, register int f)
{
int mul;
mul =e*f;
return(mul);
}
int sub(int e,int f)
int sub(int e,int f)
inline void div (int e,int f)
Recent Posts
सती रासो किसकी रचना है , sati raso ke rachnakar kaun hai in hindi , सती रासो के लेखक कौन है
सती रासो के लेखक कौन है सती रासो किसकी रचना है , sati raso ke…
मारवाड़ रा परगना री विगत किसकी रचना है , marwar ra pargana ri vigat ke lekhak kaun the
marwar ra pargana ri vigat ke lekhak kaun the मारवाड़ रा परगना री विगत किसकी…
राजस्थान के इतिहास के पुरातात्विक स्रोतों की विवेचना कीजिए sources of rajasthan history in hindi
sources of rajasthan history in hindi राजस्थान के इतिहास के पुरातात्विक स्रोतों की विवेचना कीजिए…
गुर्जरात्रा प्रदेश राजस्थान कौनसा है , किसे कहते है ? gurjaratra pradesh in rajasthan in hindi
gurjaratra pradesh in rajasthan in hindi गुर्जरात्रा प्रदेश राजस्थान कौनसा है , किसे कहते है…
Weston Standard Cell in hindi वेस्टन मानक सेल क्या है इससे सेल विभव (वि.वा.बल) का मापन
वेस्टन मानक सेल क्या है इससे सेल विभव (वि.वा.बल) का मापन Weston Standard Cell in…
polity notes pdf in hindi for upsc prelims and mains exam , SSC , RAS political science hindi medium handwritten
get all types and chapters polity notes pdf in hindi for upsc , SSC ,…