User Define Data type : Structures in hindi c कंप्यूटर भाषा में स्ट्रक्चर क्या होता है
Structure यह data type है जिसमे दो दो से अधिक datatype के data को store कर सकते है |
उदाहरण के लिए:
Date : ये day,month,year का समूह होता है |
Address : ये Building name, floor ,street name,city और pin code का समूह होता है |
Time : ये hours ,minutes और seconds का समूह होता है |
Book : ये name,writer , title और price का समूह होता है |Structure एक powerful tool है जो इस तरह के data types को handle के लिए |इस article मे structure define,Structure variable declaration और Structure member access को स्टडी करेगे |
Structure Definition :
{
int day;
जभुमे Structure के किसी variable मे value को assign करना हो या Structure के variable की value को use करना हो तब हम इसके लिए operator(MEMBER OPERATOR ‘.’) को यूज़ करेगे |इसका syntax है :
variable_name . Structure member variable _name = assign value ;
scanf और printf function statement के rules/syntax fundamental data type की तरह ही होते है |
उदहारण है :-
{
address 1.house_no=343;
address 1.floor=1
address 1.street=Ram gali ;
address 1.city=jaipur ;
address 1.pincode=302008;
printf(“%d”,address 1.floor);
printf(“%[. .]”,address 1.street);
………………………………………….;
………………………………………….;
आदि
}Structure Example :
#include<stdoio.h>
#incluide<conio.h>
{
int day;
void main()
{
struct date date_1;
printf(“Enter day”);
scanf(“%d”,&date_1.day);
printf(“Enter Month”);
scanf(“%s”,date_1.month);
printf(“Enter Year”);
scanf(“%d”,&date_1.year);
Printf(“Your Date is “);
printf(“%d”,date_1.day);printf(“/”);printf(“%s”,date_1.month);printf(“/”);printf(“%d”,date_1.year);
}आउटपुट होगा :
Enter day 12
Enter Month December
Enter year 2018
Your Date is 12/December/2018
हिंदी माध्यम नोट्स
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