C Language MCQ - English
Can you combine the following two statements into one? char *p;
p
Home | Discussion Forum
p
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 main()
{
char *p = NULL;
char *q = 0;
if (p)
printf(" p ");
else
printf("nullp");
if (q)
printf("q\n");
else
printf(" nullq\n");
}
View Answer
2) Which is an indirection operator among the following?
3) What would be the equivalent pointer expression for referring the array element a[i][j][k][l]
4) What will be the output of the following C code? #include <stdio.h>
int main()
{
int i = 10;
void *p = &i;
printf("%d\n", (int)*p);
return 0;
}
5) What will be the output of the program ? #include<stdio.h>
int main()
{
static char *s[] = {"black", "white", "pink", "violet"};
char **ptr[] = {s+3, s+2, s+1, s}, ***p;
p = ptr;
++p;
printf("%s", **p+1);
return 0;
}