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

Discussion

Which of these correctly defines STR as a name for a pointer to char ?

  • A.typedef STR char *;
  • B.typedef char *STR;
  • C.typedef *char STR;
  • D.define char *STR;

Answer: A

Correct answer: typedef char *STR;

A typedef is written exactly like a variable declaration with typedef placed in front, so the new name occupies the position the variable name would take. Reading char *STR as a declaration of STR makes the form easy to remember.

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

Post your comment

Please log in or register to post a comment.