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
हिंदी माध्यम नोट्स
Class 6
Hindi social science science maths English
Class 7
Hindi social science science maths English
Class 8
Hindi social science science maths English
Class 9
Hindi social science science Maths English
Class 10
Hindi Social science science Maths English
Class 11
Hindi sociology physics physical education maths english economics geography History
chemistry business studies biology accountancy political science
Class 12
Hindi physics physical education maths english economics
chemistry business studies biology accountancy Political science History sociology
English medium Notes
Class 6
Hindi social science science maths English
Class 7
Hindi social science science maths English
Class 8
Hindi social science science maths English
Class 9
Hindi social science science Maths English
Class 10
Hindi Social science science Maths English
Class 11
Hindi physics physical education maths entrepreneurship english economics
chemistry business studies biology accountancy
Class 12
Hindi physics physical education maths entrepreneurship english economics
Related Posts
डिजाइन टेम्पलेट computer design templates in hindi | कंप्यूटर में टेम्पलेट बनाना प्रस्तुतियाँ क्या है ?
(computer design templates in hindi) डिजाइन टेम्पलेट कंप्यूटर में टेम्पलेट बनाना प्रस्तुतियाँ क्या है ? अध्याय-8 सब्सक्राइब करे youtube चैनल प्रस्तुतियाँ: परिचयः एक प्रस्तुति और कंप्यूटर ऑपरेटिंग सिस्टम के लिए…
WWW और वेब ब्राउजर | www and web browser in hindi | world wide web in hindi
WWW और वेब ब्राउजर world wide web (www) was introduced in the year , www and web browser in hindi | world wide web in hindi अध्याय-6 सब्सक्राइब करे youtube चैनल…