C Language MCQ - English
What would be the equivalent pointer expression for referring the array element
Home | Discussion ForumWhat would be the equivalent pointer expression for referring the array element a[i][j][k][l]
Answer : B
View More Related Question
1) What would be the equivalent pointer expression for referring the array element a[i][j][k][l]
2) 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
3) What will be the output of the program ? #include<stdio.h>
int main()
{
int x=30, *y, *z;
y=&x; /* Assume address of x is 500 and integer is 4 byte size */
z=y;
*y++=*z++;
x++;
printf("x=%d, y=%d, z=%d\n", x, y, z);
return 0;
}
4) 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
5) Can you combine the following two statements into one? char *p;
p = (char*) malloc(100);
View Answer