Top

Pointers

41.

Which of the following declaration throw run-time error?

Answer: D

No answer description available for this question.
 

Enter details here

42.

Is the NULL pointer same as an uninitialised pointer?

Answer: B

No answer description available for this question.
 

Enter details here

43.

What will be the output of the program ?

#include

int main()
{
    static char *s[] = {"black", "white", "pink", "violet"};
    char **ptr[] = {s+3, s+2, s+1, s}, ***p;
    p = ptr;
    ++p;
    printf("%s", **p+1);
    return 0;
}

 

Answer: A

No answer description available for this question.

Enter details here

44.

What is the output of this C code?

int main()
{
int i = 11;
int *p = &i;
foo(&p);
printf("%d ", *p);
}
void foo(int *const *p)
{
int j = 10;
*p = &j;
printf("%d ", **p);
}

 

Answer: A

No answer description available for this question.
 

Enter details here

45.

What will be the output of the program ?

#include

int main()
{
    void *vp;
    char ch=74, *cp="JACK";
    int j=65;
    vp=&ch;
    printf("%c", *(char*)vp);
    vp=&j;
    printf("%c", *(int*)vp);
    vp=cp;
    printf("%s", (char*)vp+2);
    return 0;
}

 

Answer: D

No answer description available for this question.

Enter details here

46.

What is the output of this C code?

void foo(int*);
int main()
{
int i = 10;
foo((&i)++);
}
void foo(int *p)
{
printf("%d\n", *p);
}

 

Answer: C

No answer description available for this question.
 

Enter details here

47.

Are the three declarations char **apple, char *apple[ ], and char apple[ ][ ] same?

Answer: B

No answer description available for this question.
 

Enter details here

48.

Is there any difference between the following two statements?

char *p=0;
char *t=NULL;

 

Answer: B

No answer description available for this question.
 

Enter details here

49.

What is the output of this C code?

void main()
{
int a[3] = {1, 2, 3};
int *p = a;
int *r = &p;
printf("%d", (**r));
}

 

Answer: B

No answer description available for this question.
 

Enter details here

50.

Will the program compile in Turbo C?

#include
int main()
{
    int a=10, *j;
    void *k;
    j=k=&a;
    j++;
    k++;
    printf("%u %u\n", j, k);
    return 0;
}

 

Answer: B

No answer description available for this question.
 

Enter details here

Loading…
Tags: Pointers Questions and Answers || Pointers MCQ Questions and Answers || Pointers GK Questions and Answers || Pointers GK MCQ Questions || Pointers Multiple Choice Questions and Answers || Pointers GK || GK on Pointers || C Programming Questions and Answers || C Programming MCQ Questions and Answers || C Programming GK Questions and Answers || GK on C Programming