I am new to stuctures and have almost no knowledge about.
Could someone plaese help me giving a code of the program:
Enter Student details using Structures.
The details should include
name:
roll number:
Stream:
Contact:
Address:
Somebody plz help me....
Copyright © 2024 Q2A.MX - All rights reserved.
Answers & Comments
Verified answer
You can declare struct to be like this:(assuming those values(such as address) are char):
typedef struct student_detail_struct{
char name[100];
int roll_number;
char stream[200];
char contact[200];
char address[200];
} student_detail;
Then in your code, you can start using it:
student_detail stu1;
strcpy(stu1.name,"Name1");
stu1.roll_number = 2;
...