Home / C Programming / Typedef :: Yes / No Questions

C Programming :: Typedef

  1. Is the following declaration acceptable?

      typedef long no, *ptrtono; 
      no n;
      ptrtono p; 
    

     

  2. A.

    Yes

    B.

    NO

    View Answer

    Workspace

    Discuss Discuss in Forum


  3. Is there any difference in the #define and typedef in the following code?

     typedef char * string_t;
     #define string_d char *;
     string_t s1, s2;
     string_d s3, s4; 
    

  4. A.

    Yes

    B.

    No

    View Answer

    Workspace

    Discuss Discuss in Forum


  5. Are the properties of i, j and x, y in the following program same?

     typedef unsigned long int uli;
     uli i, j;
     unsigned long int x, y; 

     

  6. A.

    Yes

    B.

    No

    View Answer

    Workspace

    Discuss Discuss in Forum


  7. typedef's have the advantage that they obey scope rules, that is they can be declared local to a function or a block whereas #define's always have a global effect.

  8. A.
    Yes
    B.
    No

    View Answer

    Workspace

    Discuss Discuss in Forum