Sabtu, 15 April 2017

How to use structure initialiazation in array of structures

Structure Initialization Like any other data type, a structure variable can be initialized at compile time. An example of compile time initialization of the student structure is shown below: 1 2 3 4 5 6 7 8 9 struct student { char name; char rollno; int age; char grade; }; struct student student1 = {“teja”,”10A1”,26,’A’}; struct student student2 = {“raju”,”10A2”,24,’B’}; In the above example: teja, 10A1, 26 and A are assigned to student1’s name, rollno, age and grade. Whereas raju, 10A2, 24, B are assigned to student2’s name, rollno, age and grade. Note: Partial initialization of a structure variable is

The post How to use structure initialiazation in array of structures appeared first on Coding Security.


How to use structure initialiazation in array of structures
read more

Tidak ada komentar:

Posting Komentar