हिंदी माध्यम नोट्स
Pointer : Operation और Limitation क्या है , pointer’s operations and limitations in hindi in c language
जिस प्रकार किसी variable को expression मे use कर सकते है उसी प्रकार pointer variable को expression मे use कर सकते है |सभी arithmetic operation pointer के साथ perform कर सकते है |जैसे
‘a’ और ‘b’ एक well define pointer है ओए initial proper है तब नीचे दिए गए statement/expression है :-
(i) y=**a+*b;
इस statement से दोनों pointers की value का addition operation perform होगा |
(ii) sum=sum+*a;
इस statement से pointer a की value से variable sum की value मे addition होता है |
(iii) d=*a * *b;
इस statement से pointer a और b की value multiply होगी | इसे निन्म तरह से भी लिख सकते है |
d=(*a)*(*b);
(iv) c=*a/*b;
इस statement से pointer a और b की value मे division होगा |
(v) e=8* -*a**b;
ये statement गलत है क्योकि 8 के बाद ‘*’ और ‘-‘ के बीच space है जो की case sensitive होता है|
C language मे pointers का addition कर सकते है और pointer की value किसी constant मे से add या subtraction कर सकते है |
जब कभी किसी array के दो pointers ‘a’ और ‘b’ है मतलब एसे pointer जिसमे एक array के दो elements के address को store करता है तब a-b उस array के बीच वाले array के element कोshow करता है |जैसे
Pointer पर shorthand operator भी use कर सकते है |जैसे
sum+=a; या sum=sum+a;
*a+=*b; या *a=*a+*b;
Arithmetic operator के अलावा logical operator ( ==,>=,<=,<,> )pointer की value पर perform हो सकता है जैसे
if(*a<*b)
{
printf(“address of a is less than address of b”);
}
{
printf(“address of a is greater than address of b”);
}
उदहारण के लिए:
#include<conio.h>
#include<stdio.h>
vopid main()
{
int *a,*b;
int e,f,g,h,i;
printf(“Enter Data”);
scanf(“%d %d”,&e,&f);
a=&e;
b=&f;
g=*a-*b;
h=*a+*b;
i=*b+454-*a+345;
printf(“%u-%u=%d”,&e,&f,g);
printf(“%u+%u=%d”,&e,&f,h);
printf(“%u+454-%u+345=%d”,&e,&f,i);
if(*a>*b)
{
printf(“address of a is greater than address of b”);
}
{
printf(“address of a is less than address of b”);
}
#include<conio.h>
#include<stdio.h>
vopid main()
{
int *a;
char *b;
int e,f,i,g[10],h[10];
printf(“Enter one integer or charecter”);
scanf(“%d %c”,&e,&f);
a=&e;
b=&f;
for(i=0;i<10;i++)
{
f[i]=*a;
a++;
h[i]=*b;
b–;
}
for(i=0;i<10;i++)
{
printf(“%d”,f[i]);
}
for(i=0;i<10;i++)
{
printf(“%d”,h[i]);
}
#include<stdio.h>
void main()
{
char *a;
int b;
printf(“Enter data”);
scanf(“%d”,b);
a=(char*)&b;
printf(“value of a = %c”,*a);
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 ,…