logo

CuriousTab

CuriousTab

Complicated Declarations problems


  • 1. What do the following declaration signify?
    void (*cmp)();

  • Options
  • A. cmp is a pointer to an void function type.
  • B. cmp is a void type pointer function.
  • C. cmp is a function that return a void pointer.
  • D. cmp is a pointer to a function which returns void .
  • Discuss
  • 2. What do the following declaration signify?
    int *ptr[30];

  • Options
  • A. ptr is a pointer to an array of 30 integer pointers.
  • B. ptr is a array of 30 pointers to integers.
  • C. ptr is a array of 30 integer pointers.
  • D. ptr is a array 30 pointers.
  • Discuss
  • 3. What will be the output of the program in Turbo C?
    #include<stdio.h>
    
    int main()
    {
        char near *near *ptr1;
        char near *far *ptr2;
        char near *huge *ptr3;
        printf("%d, %d, %d\n", sizeof(ptr1), sizeof(ptr2), sizeof(ptr3));
        return 0;
    }
    

  • Options
  • A. 4, 4, 8
  • B. 4, 4, 4
  • C. 2, 4, 8
  • D. 2, 4, 4
  • Discuss
  • 4. What will be the output of the program?
    #include<stdio.h>
    
    int main()
    {
        char huge *near *ptr1;
        char huge *far *ptr2;
        char huge *huge *ptr3;
        printf("%d, %d, %d\n", sizeof(ptr1), sizeof(ptr2), sizeof(ptr3));
        return 0;
    }
    

  • Options
  • A. 4, 4, 8
  • B. 2, 4, 4
  • C. 4, 4, 2
  • D. 2, 4, 8
  • Discuss
  • 5. What will be the output of the program (in Turbo C under DOS)?
    #include<stdio.h>
    
    int main()
    {
        char huge *near *far *ptr1;
        char near *far *huge *ptr2;
        char far *huge *near *ptr3;
        printf("%d, %d, %d\n", sizeof(ptr1), sizeof(ptr2), sizeof(ptr3));
        return 0;
    }
    

  • Options
  • A. 4, 4, 8
  • B. 2, 4, 4
  • C. 4, 4, 2
  • D. 2, 4, 8
  • Discuss
  • 6. What will be the output of the program under DOS?
    #include<stdio.h>
    
    int main()
    {
        char huge *near *far *ptr1;
        char near *far *huge *ptr2;
        char far *huge *near *ptr3;
        printf("%d, %d, %d\n", sizeof(ptr1), sizeof(**ptr2), sizeof(ptr3));
        return 0;
    }
    

  • Options
  • A. 4, 4, 4
  • B. 4, 2, 2
  • C. 2, 8, 4
  • D. 2, 4, 8
  • Discuss
  • 7. What will be the output of the program?
    #include<stdio.h>
    
    int main()
    {
        char far *near *ptr1;
        char far *far *ptr2;
        char far *huge *ptr3;
        printf("%d, %d, %d\n", sizeof(ptr1), sizeof(ptr2), sizeof(ptr3));
        return 0;
    }
    

  • Options
  • A. 4, 4, 8
  • B. 4, 4, 4
  • C. 2, 4, 4
  • D. 2, 4, 8
  • Discuss
  • 8. What will be the output of the program?
    #include<stdio.h>
    
    int main()
    {
        char huge *near *far *ptr1;
        char near *far *huge *ptr2;
        char far *huge *near *ptr3;
        printf("%d, %d, %d\n", sizeof(ptr1), sizeof(*ptr2), sizeof(**ptr3));
        return 0;
    }
    

  • Options
  • A. 4, 4, 4
  • B. 2, 4, 4
  • C. 4, 4, 2
  • D. 2, 4, 8
  • Discuss
  • 9. What will be the output of the program?
    #include<stdio.h>
    typedef void v;
    typedef int i;
    
    int main()
    {
        v fun(i, i);
        fun(2, 3);
        return 0;
    }
    v fun(i a, i b)
    {
        i s=2;
        float i;
        printf("%d,", sizeof(i));
        printf(" %d", a*b*s);
    }
    

  • Options
  • A. 2, 8
  • B. 4, 8
  • C. 2, 4
  • D. 4, 12
  • Discuss
  • 10. What will be the output of the program?
    #include<stdio.h>
    typedef unsigned long int uli;
    typedef uli u;
    
    int main()
    {
        uli a;
        u b = -1;
        a = -1;
        printf("%lu, %lu", a, b);
        return 0;
    }
    

  • Options
  • A. 4343445454, 4343445454
  • B. 4545455434, 4545455434
  • C. 4294967295, 4294967295
  • D. Garbage values
  • Discuss

First 2 3