All three questions use the following structure declaration. struct Date { int d
ID: 3619290 • Letter: A
Question
All three questions use the following structure declaration. struct Date { int day; int month; int year; }; 1. Write a definition statement that defines a Date structure variable initialized with the following data: day: 28 month: 6 year: 2010 2. Suppose datePtr is a pointer to a Date structure. Which of the following is the correct way to access the day member? a. datePtr.day b. datePtr->day c. (*datePtr).day d. *datePtr.day e. b and c f. a and d 3. Write a function that accepts a Date structure as its argument and displays the structure’s contents on the screen.Explanation / Answer
DearGiven struct Date { int day; intmonth; int year; }; 1. //defniningdata structure Date today; today.day=28; today.month=6; today.year=2010; 2. if datePtr is a pointer of date type Suppose datePtr is a pointer toa Date structure. Which of the following is the correct way toaccess the day member? a. datePtr.day b. datePtr->day c. (*datePtr).day d. *datePtr.day e. b andc f. a and d 3. function defnition void display(Date now) { cout<<"Today's dateis:"<<now.day<<"/"<<now.month<<"/"<<now.year<<endl; } Hope this will help you.. Hope this will help you..