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
- ptr = malloc(m*n); strcpy(p, u);
- memset(0, m*n);
- ptr = malloc (m*n); memset (p, 0, m*n);
- All of the above
- Both are exactly same
- Array is a constant pointer
- Pointer is an one-dimensional and dynamic array
- None of the these
#include <stdio.h>
void main()
{
char *a[10] = {"hi", "hello", "how"};
printf("%d\n", sizeof(a));
}
- 30
- 40
- 20
- 10
void main()
{
int k = 5;
int *p = &k;
int **m = &p;
**m = 6;
printf("%d\n", k);
}
- 4
- 7
- 6
- Compilation error
#include <stdio.h>
void main()
{
char *a[10] = {"hi", "hello", "how"};
printf(
- 6
- 4
- 1
- 5