Pointers in C Programming MCQ (Multiple Choice Questions And Answers)
Are you preparing for the next job interviews? If yes, trust me this post will help you also we'll suggest you check out a big collection for Programming Full Forms that may help you in your interview:
List of Programming Full Forms
int main()
{
int i = 10;
int *const p = &i;
foo(&p);
printf("%d\n", *p);
}
void foo(int **p)
{
int j = 11;
*p = &j;
printf("%d\n", **p);
}
- 11 12
- 11 11
- Segment Fault
- Error
- func($array);
- func(*array);
- func(array);
- func(&array);
#include <stdio.h>
void main()
{
char *a[10] = {"hi", "hello", "how"};
int i = 0, j = 0;
a[0] = "hey";
for (i = 0;i < 10; i++)
printf("%s\n", a[i]);
}
- hey hello how Segmentation fault
- hi hello how Segmentation fault
- hi hello how followed by 7 null values
- Compilation error
char *p;
p = (char*) malloc(100);
- char *p = (char *)(malloc*)(100);
- char *p = (char*)malloc(100);
- char p = *malloc(100);
- char *p = (char) malloc(100);
- stdio.h
- math.h
- stddef.h
- stdio.h and stddef.h