41. The operator > and < are meaningful when used with pointers, if
42. The declaration
int (*p) [5];
means
int (*p) [5];
means
43. Comment on the following?
const int *ptr;
const int *ptr;
44. Determine Output:
#include<stdio.h>
void main()
{
int *ptr, a=10;
ptr = &a;
*ptr += 1;
printf("%d, %d", *ptr, a);
}
#include<stdio.h>
void main()
{
int *ptr, a=10;
ptr = &a;
*ptr += 1;
printf("%d, %d", *ptr, a);
}
45. A function 'p' that accepts a pointer to a character as argument and returns a pointer to an array of integer can be declared as
46. What will be printed after compiling and running the following code?
main()
{
char *p;
printf("%d %d",sizeof(*p), sizeof(p));
}
main()
{
char *p;
printf("%d %d",sizeof(*p), sizeof(p));
}
47. What will be the output of the following program code?
#include <stdio.h>
void main()
{
int i=3, *j, **k;
j = &i;
k = &j;
printf("%d%d%d", *j, **k, *(*k));
}
#include <stdio.h>
void main()
{
int i=3, *j, **k;
j = &i;
k = &j;
printf("%d%d%d", *j, **k, *(*k));
}
48. Which of the following is the correct way of declaring a float pointer:
49. Find the output of the following program.
void main()
{
char *msg = "hi";
printf(msg);
}
void main()
{
char *msg = "hi";
printf(msg);
}
50. Find the output of the following program.
void main()
{
int array[10];
int *i = &array[2], *j = &array[5];
int diff = j-i;
printf("%d", diff);
}
void main()
{
int array[10];
int *i = &array[2], *j = &array[5];
int diff = j-i;
printf("%d", diff);
}
Read More Section(Pointer)
Each Section contains maximum 100 MCQs question on Pointer. To get more questions visit other sections.