C Language MCQ - English
If a variable is a pointer to a structure, then which of the following operator
Home | Discussion ForumIf a variable is a pointer to a structure, then which of the following operator is used to access data members of the structure through the pointer variable?
Answer : D
View More Related Question
1) What will be the output of the following C code? #include <stdio.h> int *f();
int main()
{
int *p = f();
printf("%d\n", *p);
}
int *f()
{
int *j = (int*)malloc(sizeof(int));
*j = 10;
return j;
}
View Answer
2) If a variable is a pointer to a structure, then which of the following operator is used to access data members of the structure through the pointer variable?
3) What will be the output of the program ? #include<stdio.h>
int main()
{
char str[20] = "Hello";
char *const p=str;
*p='M';
printf("%s\n", str);
return 0;
}
4) What will be the output of the following C code? #include <stdio.h>
int main()
{
int i = 10;
void *p = &i;
printf("%f\n", *(float*)p);
return 0;
}
5) A pointer is
View Answer