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

Home | Discussion Forum
Taiyari24Hour

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 x = 0;
void main()
{
int *const ptr = &x;
printf("%p\n", ptr);
ptr++;
printf("%p\n ", ptr);
}

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

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>
void main()
{
int x = 0;
int *ptr = &5;
printf("%p\n", ptr);
}

5) Which of the following does not initialize ptr to null (assuming variable declaration of a as int a=0;)?

UP Gk Online Test

taiyari24hour.com

Study 2 Online Says....
Kindly log in or signup.