JOIN us on
WhatsApp Group Join Now
Telegram Join Join Now

हिंदी माध्यम नोट्स

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

Home science Geography

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

chemistry business studies biology accountancy

Categories: C Language in hindi

Structure : Operation or Memory Representation in hindi स्ट्रक्चर : ऑपरेशन या मेमोरी रिप्रजेंटेशन हिंदी में c कंप्यूटर भाषा

स्ट्रक्चर : ऑपरेशन या मेमोरी रिप्रजेंटेशन हिंदी में c कंप्यूटर भाषा Structure : Operation or Memory Representation in hindi :-
Structure initialization : Structure data type को initial करने के लिए निम्न syntax को फॉलो करता है :-
struct address
{
int house ;
int floor;
char street[20];
char city ;
};
void main(){
struct address add 1={ 203 , 1, Sita ram ki gali ,jaipur };
printf(“%d”,add 1.house);
printf(“%d”,add 1.floor);
printf(“[. .]”,add 1.street);
printf(“%s”,add 1.city);
getch();
}Structure initialization मे निन्म syntax होते है :-
struct : struct keyword है |
Structure_name : ये Structure का नाम है |
variable _name : ये variable का नाम है जिसके members मे values को assign करना है |
Assignment operator : इसका use value को Structure में member मे assign करने के लिए किया जाता है |
values : इसमें declare Structureके सभी members के लिए values को {} मे क्लोज करते है |

Structure initialization के कुछ rules :
1.Structure के केवल एक member को initialization नहीं कर सकते है |
2.type और order of values और type और order of Structure member same होनी चाहिए |
3.Structure के कुछ members को  initialization कर सकते है लेकिन Non initialization members Structure के last members होने चाहिए |
4. जब तक Structure को  initialization नहीं करते है तब  तक इसमें default values assign होती है |जैसे
integer के लिए zero
और character or string के लिए null (‘/0’)

Operation :

1.Copying और Comparing
Copying operation :
जब किसी एक Structure को दुसरे Structure मे copy करना होता है ,tab इसे assignment operator से किया जा सकता है |अगर S1 और S2 दो Structure है तब S1=S2 होने पर Structure ‘S2’ की value Structure ‘S1’ मे copy हो जाती है अगर ‘S1’ और ‘S2’ same Structure के variable होते है |

उदहारण के लिए ;
struct address
{
int house ;
int floor;
char street[20];
char city ;
};
void main()
{struct address add1={ 203 , 1, Sita ram ki gali ,jaipur };
struct address add2;
add2=add2;
printf(“%d”,add 2.house);
printf(“%d”,add 2.floor);
printf(“[. .]”,add 2.street);
printf(“%s”,add 2.city);
getch();
}

Comparing
Comparing  operation, copying operation के तरह नहीं होती है |Comparing  operation किसी
Structure के members मे होता है |इसके उदहारण है :-
#include<conio.h>
#include<stdio.h>
#include<string.h>
struct address
{
int house ;
int floor;
char street[20];
char city ;
};
void main()
{struct address add1={ 203 , 1, Sita ram ki gali ,jaipur };
struct address add2={ 34 , 2,Shri ram ki gali ,jaipur };
if(add1.city==add2.city)
{
printf(“A और B are same city %s.”,add1.city);
}
getch();
}

Airthmatic Operation  :
Airthmatic operation किसी Structure के members मे होता है | इसके उदहारण है :-

struct address
{
int house ;
int floor;
char street[20];
char city ;
};
void main()
{struct address add1={ 203 , 1, Sita ram ki gali ,jaipur };
struct address add2={ 34 , 2,Shri ram ki gali ,jaipur };
struct address add3;
add3.street=strcat(add1.street,add2.street);
add3.house=add1.house+add2.house;
add3.city=add2.city;
printf(“%s”,add3.city);
printf(“%d”,add3.floor);
printf(“%[. .]”,add3.street);
getch();
}

Typedef :
Typedef C language का यो keyword है जिससे किसी user define function को नया नाम दे सकते है|typedef  keyword का use Structure के साथ भी कर सकते है |इसका syntax है:-
typedef struct
{
member 1;
member 2;
…………….;
…………….;
member n;
}type_name ;

यह पर type_name का use किसी variable को declare करने के लिए किया जाता है
(i)|typedef के साथ ,हम variable को Structure definition मे define नहीं कर सकते है |
(ii)और type name, type definition name है variable का नहीं |
उदहारण के लिए :
#include<stdio.h>
#include<conio.h>
typedef struct
{
long int mobile ;
char name [15];
int age ;
char sex[5];
}person;
void main()
person person_1;
printf(“Enter name”);
person1.name=gets();
printf(“Enter mobile “);
scanf(“%l”,&person1.mobile);
printf(“Enter age “);
scanf(“dl”,&person1.age);
printf(“Enter sex “);
scanf(“%s”,&person1.sex);
printf(“Profile of %[..]”,person1.name );
printf(“%d”,person1.age);
printf(“%l”,person1.floor);
printf(“%s”,person1.sex);
getch();
}

Memory Representation :
computer, Structure को “word boundaries” के concept से memory allocate करता है |word boundaries की size कंप्यूटर पर निर्भर करती है |
अगर कंप्यूटर जो 2 bytes का है तब Structure की members,word boundaries के left aligned मे store हो जाता है |character data, 1 bytes occupy करता है और integer data, 2 bytes occupy करेगा | इन दोनों के बीच एक empty बिट होती है जिसे slack बाइट कहते है |

Sbistudy

Recent Posts

four potential in hindi 4-potential electrodynamics चतुर्विम विभव किसे कहते हैं

चतुर्विम विभव (Four-Potential) हम जानते हैं कि एक निर्देश तंत्र में विद्युत क्षेत्र इसके सापेक्ष…

2 days ago

Relativistic Electrodynamics in hindi आपेक्षिकीय विद्युतगतिकी नोट्स क्या है परिभाषा

आपेक्षिकीय विद्युतगतिकी नोट्स क्या है परिभाषा Relativistic Electrodynamics in hindi ? अध्याय : आपेक्षिकीय विद्युतगतिकी…

4 days ago

pair production in hindi formula definition युग्म उत्पादन किसे कहते हैं परिभाषा सूत्र क्या है लिखिए

युग्म उत्पादन किसे कहते हैं परिभाषा सूत्र क्या है लिखिए pair production in hindi formula…

6 days ago

THRESHOLD REACTION ENERGY in hindi देहली अभिक्रिया ऊर्जा किसे कहते हैं सूत्र क्या है परिभाषा

देहली अभिक्रिया ऊर्जा किसे कहते हैं सूत्र क्या है परिभाषा THRESHOLD REACTION ENERGY in hindi…

6 days ago

elastic collision of two particles in hindi definition formula दो कणों की अप्रत्यास्थ टक्कर क्या है

दो कणों की अप्रत्यास्थ टक्कर क्या है elastic collision of two particles in hindi definition…

6 days ago
All Rights ReservedView Non-AMP Version
X

Headline

You can control the ways in which we improve and personalize your experience. Please choose whether you wish to allow the following:

Privacy Settings
JOIN us on
WhatsApp Group Join Now
Telegram Join Join Now