Initializing and Accessing of structure Member

Page 1

Initializing and Accessing Structure member In C Language | Programmerdouts programmerdouts.blogspot.com/2019/06/initialize-access-strucure-c.html

Initializing and Accessing structure Member As we have learned how to declare and define the structure, now it's time for initializing the structure and Accessing Element of structure. Let's start doing it. Let's define a structure Student with name , rollno, div as it's attribute.

Definition: struct student //structure name { int rollno; //member1 ,integer variable which will store, //student roll no. char name[20]; //member2 a character array of 20 character //which will store name of student. char div; //member3 a character variable, //which will store division of student. }; As we have define structure let's initialize it.

Initializing the variable s1

1/8


Turn static files into dynamic content formats.

Create a flipbook
Issuu converts static files into: digital portfolios, online yearbooks, online catalogs, digital photo albums and more. Sign up and create your flipbook.