Question: Using the above example as guideline please define a struct named Student, with two data members: name and rollnumber . Write a program that demonstrates
Using the above example as guideline please define a struct named Student, with two
data members: name and rollnumber
Write a program that demonstrates the following:
a Create a Student variable and access its data members. Please use your own
name and rollnumber.
b Create a Student pointer that carries the address of the variable declared in step
a and access its data members via the pointer.
c Write a function that takes as parameter the Student variable declared in step a
and displays its data members
d Create a dynamic array of Students after asking the user about the number of
Students they would like to enter and then uses the function written above in a
loop to get data for the students. Display the data in another loop.
A Please declare a struct called Date which should carry integer data members
called day, month and year.
B Now for the Student struct you declared in exercise add dateofbirth data
member whose datatype would be Date.
C Please demonstrate setting and then displaying values for the date of birth of a
Student variable. You may reuse the code you wrote for exercise
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
