stud1.r_no = 10;
strcpy(stud1.name , “Ram” );
strcpy (stud1.address , “Ayodhya”);
scanf(“%d”,&stud2.r_no);
scanf(“%s”,stud2.name);
static struct student { …} stud3 = {20, ”Bharat” ,”Ayodhya”}
static struct student student4= {30, “Shatrughna”, “Ayodhya”}
struct student{…} stud1 = {40, “Laxman”, “Ayodhya” } // No static!
main()
{ struct student student2 = {…}
}
Note : C does not support initialization to the template variables, it must be done to actual variables.