44.
What type of initialization is needed for the segment "ptr[3] = '3';" to work?

45.
What will be the output of the following C code?
#include <stdio.h>
void main()
{
    int k = 5;
    int *p = &k;
    int **m  = &p;
    printf("%d%d%d\n", k, *p, **m);
}

46.
What will be the output of the following C code?
#include <stdio.h>
void main()
{
    struct student
    {
        int no;
        char name[20];
    };
    struct student s;
    s.no = 8;
    printf("%s", s.name);
}

47.
What will be the output of the following C code?
#include <stdio.h>
int main()
{
    int ary[4] = {1, 2, 3, 4};
    int *p = ary + 3;
    printf("%d %d\n", p[-2], ary[*p]);
}

48.
What will be the output of the following C code?
#include <stdio.h>
void m(int p, int q)
{
    printf("%d %d\n", p, q);
}
void main()
{
    int a = 6, b = 5;
    m(a);
}

49.
What will be the output of the following C code?
#include <stdio.h>
void f(int (*x)(int));
int myfoo(int);
int (*fooptr)(int);
int ((*foo(int)))(int);
int main()
{
    fooptr = foo(0);
    fooptr(10);
}
int ((*foo(int i)))(int)
{
    return myfoo;
}
int myfoo(int i)
{
    printf("%d\n", i + 1);
}

Read More Section(Pointer)

Each Section contains maximum 100 MCQs question on Pointer. To get more questions visit other sections.