What would be the equivalent pointer expression for referring the array element

Home | Discussion Forum

What would be the equivalent pointer expression for referring the array element a[i][j][k][l]

View More Related Question

1) Comment on the following pointer declaration.

 int *ptr, p;

2) Can you combine the following two statements into one?

   char *p; 
p = (char*) malloc(100);

3) What will be the output of the following C code?

 #include <stdio.h>
int main()
{
int *ptr, a = 10;
ptr = &a;
*ptr += 1;
printf("%d,%d/n", *ptr, a);
}

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) 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;
}

UP Gk Online Test

taiyari24hour.com