If a variable is a pointer to a structure, then which of the following operator

Home | Discussion Forum

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?

View More Related Question

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

2) What is (void*)0?

3) Comment on the following C statement.

  const int *ptr;

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

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

UP Gk Online Test

taiyari24hour.com