हिंदी माध्यम नोट्स
Pointer In Structure (Data Type) in hindi in c language पॉइंटर को स्ट्रक्चर के रूप में कैसे काम में लेते है
contain करते है उसी प्रकार structure data type मे भी array ऑफ़ structure के
first variable के address को contain करता है |
int house ;
और city जो की अलग अलग data type के है को contain करता है |
होती है |
होता है |
value store होगी |
add data type store कर सकता है |इस array को handle करने के लिए pointer ‘a’ को
use किया जाता है |
address store होता है |जब a++;
address मे increment हो जायेगा |और pointer ‘a’ मे array element a[1] का address
store हो जायेगा |
operator कहते है |
सेलेक्ट होगा |
1,a[0] का memeber city सेलेक्ट होगा |
इस उदहारण मे ,दो
record सेव होगे इसलिय इसमें structure data type ‘book’ के दो variable का array
को use करता है |जैसे
record 2 मे data read होगा |
kalam Price:230
Bhagat Price:250
Sorting Program
जब किसी array के element को sort किया जाता है तब उस प्रोग्रम को pointer से easily handle हो सकता है |
source code
#include<conio.h>
#include<stdio.h>
void sort(int ,int *);’
void main()
{
int i;
int size=8;
int d[8]={12,56,23,45,76,65,96,32};
sort (size,a);
printf(“Sorted Array “);
for(i=0;i<8;i++)
{
printf(“%d”,d[i]);
}
getch();
}
void sort (int n,int *a)
{
int e,f,t;
for(e=1;e<=n-1;e++)
{
for(f=1;f<n-1;f+
{
if(*(a+f-1)>=*(a+f))
{
t=*(a+f-1);
*(a+f-1)=*(a+f);
*(a+f)=t;
}
}
इस प्रोग्रम मे array को function argument मे pass करते है |और pointer variable ‘a’ मे receive कर देते है |comparison और swapping प्रोसेस मे pointer variable की value को use किया है जो की array element के address है |
आउटपुट होगा :
Sorted Array
96 76 65 56 45 32 23 12
Recent Posts
Question Tag Definition in english with examples upsc ssc ias state pcs exames important topic
Question Tag Definition • A question tag is a small question at the end of a…
Translation in english grammer in hindi examples Step of Translation (अनुवाद के चरण)
Translation 1. Step of Translation (अनुवाद के चरण) • मूल वाक्य का पता करना और उसकी…
Report Writing examples in english grammer How to Write Reports explain Exercise
Report Writing • How to Write Reports • Just as no definite rules can be laid down…
Letter writing ,types and their examples in english grammer upsc state pcs class 12 10th
Letter writing • Introduction • Letter writing is an intricate task as it demands meticulous attention, still…
विश्व के महाद्वीप की भौगोलिक विशेषताएँ continents of the world and their countries in hindi features
continents of the world and their countries in hindi features विश्व के महाद्वीप की भौगोलिक…
भारत के वन्य जीव राष्ट्रीय उद्यान list in hin hindi IAS UPSC
भारत के वन्य जीव भारत में जलवायु की दृष्टि से काफी विविधता पाई जाती है,…