Accessing Structure Members


Once structure has been defined, its members can be accessed using dot operator (.) Thus , linking a variable with a member with a dot operator helps us to access the member of a structure. The members of the student structure variable s1 can be assessed using a dot operator as follows,

s1 . rollno will acess s1’s rollno
s1 . name will acess s1’s name
s1.  marks will acess s1’s marks

Previous                                                                                    Next


Powered by Blogger.