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

Discussion

Which of the following is FALSE about typedef?

  • A.typedef follow scope rules
  • B.typedef defined substitutes can be redefined again. (Eg: typedef char a; typedef int a;)
  • C.You cannot typedef a typedef with other term.
  • D.All of the mentioned

Answer: B

Correct answer: typedef defined substitutes can be redefined again. (Eg: typedef char a; typedef int a;)

This is the false statement. Repeating a typedef name with a different type in the same scope is an error, because the compiler enforces the alias as a genuine type declaration. The other two statements are true: typedefs obey the usual scope rules, so one declared inside a function is local to it.

No comment is present. Be the first to comment.
Loading…

Post your comment

Please log in or register to post a comment.