C Programming - Structures, Unions, Enums - Discussion
Discussion Forum : Structures, Unions, Enums - Point Out Correct Statements (Q.No. 3)
3.
Which of the following statements correctly assigns 12 to month using pointer variable pdt?
#include<stdio.h>
struct date
{
int day;
int month;
int year;
};
int main()
{
struct date d;
struct date *pdt;
pdt = &d;
return 0;
}
Discussion:
14 comments Page 2 of 2.
Pravin pandhare said:
9 years ago
d.month=10;
printf("%d",d.month);
Output: 10.
printf("%d",d.month);
Output: 10.
Babita said:
1 decade ago
-> is used to access pointer.
LuisSpain said:
1 decade ago
I can't still get the 45 value.
Taran rishit said:
7 years ago
(*d).month is valid I think.
Post your comments here:
Quick links
Quantitative Aptitude
Verbal (English)
Reasoning
Programming
Interview
Placement Papers