Question: 3- ( Structure s) Choose the best answer on the following questions: (I). Which of the following accesses a variable in structure b? A. b->var;
3- ( Structure s) Choose the best answer on the following questions:
(I). Which of the following accesses a variable in structure b?
A. b->var;
B. b.var;
C. *b-var;
D. b>-var;
(II). Which of the following accesses a variable in a pointer to a structure, *b?
A. b->var;
B. b.var;
C. *b-var;
D. *b>var;
(III). Which of the following is a properly defined struct?
A. struct {int a,b;}
B. struct a_struct {int a,b; }
C. struct a_struct int a,b;
D. struct a_struct {int a;};
(IV). Which properly declares a variable of struct foo?
A. struct foo;
B. struct foo var;
C. foo;
D. int foo;
(V.1) What is the output of this C code?
1. #include
2. void main()
3. {
4. struct student
5. {
6. int no;
7. char name[20];
8. };
9. struct student s;
10. no = 8;
11. printf("%d", no);
12. }
a) Nothing
b) Compile time error
c) Junk
d) 8
(V.2) How do you update the code above to correct the output.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
