Check out example codes for "struct in C". It will help you in understanding the concepts better.

Code Example 1


struct Student{
long int rollNo;
int age;
char name[50];
int totalMarks;

int main(){

    struct Student s1;
    //accessing members of the struct
    s1.rollNo = 1232234643;
    s1.age = 10;
    char s[]="Jonathan";
    s1.totalMarks = 450;

    printf("RollNumber: %d \nName: %s \nTotal Marks: %d",s1.rollNo,,s1.totalMarks);

return 0;

Code Example 2

typedef struct {
	char cognome[30];
	char nome[20];
	int voto;

Learn ReactJs, React Native from