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

Discussion

Which properly declares a variable of struct foo?

  • A.struct foo;
  • B.struct foo var;
  • C.foo;
  • D.int foo;

Answer: B

Correct answer: struct foo var;

In C the type is struct foo, two words - the keyword cannot be dropped unless a typedef has provided a single-word name. struct foo; alone merely declares that the tag exists.

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

Post your comment

Please log in or register to post a comment.