Top

Discussion

We want to declare x, y and z as pointers of type int. The alias name given is: intpt The correct way to do this using the keyword typedef is:

  • A.
    int typedef* intptr;
    int x,y,z;
  • B.
    typedef* intptr;
    int x,y,z;
  • C.
    int typedef* intptr;
    intptr x,y,z;
  • D.
    typedef int* intptr;
    intptr x,y,z;

Answer: D

It shows the correct way to declare x, y and z as pointers of type int using the keyword typedef. The advantage of using typedef with pointers is that we can declare any number of pointers in a single statement.

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

Post your comment