C Language MCQ - English
Can you combine the following two statements into one? char *p;
p = (char*) malloc(100);
Answer : C
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) In which header file is the NULL macro defined?
3) 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?
4) What will be the output of the following C code? #include <stdio.h>
int x = 0;
void main()
{
int *const ptr = &x;
printf("%p\n", ptr);
ptr++;
printf("%p\n ", ptr);
}
5) Which of the following does not initialize ptr to null (assuming variable declaration of a as int a=0;)?