11. How many number of pointer (*) does C have against a pointer variable declaration?
12. Which type of variables can have the same name in a different function?
13. Which is true for a, if a is defined as "int a[10][20];"?
14. Which of the following expression is true for the following C statement?
ptr is array with 3 elements of pointer to function returning pointer of int
ptr is array with 3 elements of pointer to function returning pointer of int
15. What will be the output of the following C code?
#include <stdio.h>
int main()
{
char a[2][6] = {"hello", "hi"};
printf("%d", sizeof(a));
return 0;
}
#include <stdio.h>
int main()
{
char a[2][6] = {"hello", "hi"};
printf("%d", sizeof(a));
return 0;
}
16. What will be the output of the following C code?
#include <stdio.h>
int main()
{
int a[4] = {1, 2, 3, 4};
void *p = &a[1];
void *ptr = &a[2];
int n = 1;
n = ptr - p;
printf("%d\n", n);
}
#include <stdio.h>
int main()
{
int a[4] = {1, 2, 3, 4};
void *p = &a[1];
void *ptr = &a[2];
int n = 1;
n = ptr - p;
printf("%d\n", n);
}
17. What will be the output of the following C code?
#include <stdio.h>
void main()
{
int x = 0;
int *ptr = &x;
printf("%p\n", ptr);
ptr++;
printf("%p\n ", ptr);
}
#include <stdio.h>
void main()
{
int x = 0;
int *ptr = &x;
printf("%p\n", ptr);
ptr++;
printf("%p\n ", ptr);
}
18. What does argc and argv indicate in command-line arguments?
(Assuming: int main(int argc, char *argv[]) )
(Assuming: int main(int argc, char *argv[]) )
19. What are the applications of a multidimensional array?
20. What is the second argument in command line arguments?
Read More Section(Pointer)
Each Section contains maximum 100 MCQs question on Pointer. To get more questions visit other sections.