Home / CSE MCQs / C-MCQs :: Typedef

CSE MCQs :: C-MCQs

  1. The correct syntax to use typedef for struct is.
  2. A.
    typedef struct temp
    {
          
    B.
    typedef struct
    {
          int a;
    }TEMP;
    C.
    struct temp
    {
          int a;
    };
    typedef struct temp TEMP;
    D.
    All of the mentioned

  3. For the following expression to work, which option should be selected.
          string p = "HELLO;
  4. A.
    typedef char [] string;
    B.
    typedef char * string;
    C.
    Both (a) and (b)
    D.
    Such expression cannot be generated in C

  5. Which of the following is FALSE about typedef?
  6. 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

  7. typedef which of the following may create problem in the program?
  8. A.
    ;
    B.
    printf/scanf
    C.
    Arithmetic operators
    D.
    All of the mentioned.

  9. typedef int (*PFI)(char *, char *)creates:
  10. A.
    type PFI, for pointer to function (of two char * arguments) returning int
    B.
    Error
    C.
    type PFI, function (of two char * arguments) returning int
    D.
    type PFI, for pointer

  11. typedef declaration:
  12. A.
    Does not create a new type
    B.
    It merely adds a new name for some existing type.
    C.
    Both a & b
    D.
    None of the mentioned