Discussion
In the following program snippet, both s1 and s2 would be variables of structure type defined as below and there won't be any compilation issue.
typedef struct Student
{
int rollno;
int total;
} Student;
Student s1;
struct Student s2;
Answer: A
Correct answer: TRUE
Both spellings are valid. The typedef creates the name Student, usable on its own; and because the structure also has the tag Student, struct Student is valid too. Tags and ordinary identifiers live in separate namespaces in C, so the same word can serve as both without conflict.
No comment is present. Be the first to comment.
Loading…
Post your comment
Please log in or register to post a comment.
Examination Categories
- SSC Exams
- Banking Exams
- Teaching Exams
- Civil Services Exams
- Railways Exams
- Engineering Recruitment Exams
- Defence Exams
- State Government Exams
- Police Exams
- Insurance Exams
- Nursing Exams
- Other Government Exams
- NRA CET
- PG Entrance Exams
- Campus Placement
- MBA Entrance Exams
- CUET and UG Entrance
- Judiciary Exams
- Regulatory Body Exams
- Software Development