31. Determine Output:
void main()
{
char far *farther, *farthest;
printf("%d..%d", sizeof(farther), sizeof(farthest));
}
void main()
{
char far *farther, *farthest;
printf("%d..%d", sizeof(farther), sizeof(farthest));
}
32. Determine Output:
main()
{
char *str1 = "abcd";
char str2[] = "abcd";
printf("%d %d %d", sizeof(str1), sizeof(str2), sizeof("abcd"));
}
main()
{
char *str1 = "abcd";
char str2[] = "abcd";
printf("%d %d %d", sizeof(str1), sizeof(str2), sizeof("abcd"));
}
33. Choose the best answer.
Prior to using a pointer variable
Prior to using a pointer variable
34. Comment on the following pointer declaration?
int *ptr, p;
int *ptr, p;
35. What will be the output?
main()
{
char *p;
p = "Hello";
printf("%cn",*&*p);
}
main()
{
char *p;
p = "Hello";
printf("%cn",*&*p);
}
36. Determine output:
#include <stdio.h>
void main()
{
char *p = NULL;
char *q = 0;
if(p)
printf(" p ");
else
printf("nullp");
if(q)
printf("q");
else
printf(" nullq");
}
#include <stdio.h>
void main()
{
char *p = NULL;
char *q = 0;
if(p)
printf(" p ");
else
printf("nullp");
if(q)
printf("q");
else
printf(" nullq");
}
37. The address operator &, cannot act on
38. The statement
int **a;
39. What will be the output of the following program?
#include<stdio.h>
void main()
{
int i = 10;
void *p = &i;
printf("%d\n", (int)*p);
}
#include<stdio.h>
void main()
{
int i = 10;
void *p = &i;
printf("%d\n", (int)*p);
}
40. What will be the output of the following program code?
#include<stdio.h>
void main()
{
int i = 10;
void *p = &i;
printf("%f", *(float *)p);
}
#include<stdio.h>
void main()
{
int i = 10;
void *p = &i;
printf("%f", *(float *)p);
}
Read More Section(Pointer)
Each Section contains maximum 100 MCQs question on Pointer. To get more questions visit other sections.