Machine-translated by Google. Questions are authored in English.
Top

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;

 

  • A.TRUE
  • B.FALSE

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.