void main()
{
void *v;
int integer=2;
int *i=&integer;
v=i;
printf("%d",(int*)*v);
}
Answer / susie
Answer :
Compiler Error. We cannot apply indirection on type void*.
Explanation:
Void pointer is a generic pointer type. No pointer
arithmetic can be done on it. Void pointers are normally
used for,
1. Passing generic pointers to functions and returning such
pointers.
2. As a intermediate pointer type.
3. Used when the exact pointer type will be known at a later
point of time.
Is This Answer Correct ? | 11 Yes | 1 No |
#define int char main() { int i=65; printf("sizeof(i)=%d",sizeof(i)); }
abcdedcba abc cba ab ba a a
Given a spherical surface, write bump-mapping procedure to generate the bumpy surface of an orange
main() { int (*functable[2])(char *format, ...) ={printf, scanf}; int i = 100; (*functable[0])("%d", i); (*functable[1])("%d", i); (*functable[1])("%d", i); (*functable[0])("%d", &i); } a. 100, Runtime error. b. 100, Random number, Random number, Random number. c. Compile error d. 100, Random number
write the function. if all the character in string B appear in string A, return true, otherwise return false.
main() { signed int bit=512, i=5; for(;i;i--) { printf("%d\n", bit >> (i - (i -1))); } } a. 512, 256, 0, 0, 0 b. 256, 256, 0, 0, 0 c. 512, 512, 512, 512, 512 d. 256, 256, 256, 256, 256
why is printf("%d %d %d",i++,--i,i--);
#include<stdio.h> main() { struct xx { int x; struct yy { char s; struct xx *p; }; struct yy *q; }; }
what will be the output of this program? void main() { int a[]={5,10,15}; int i=0,num; num=a[++i] + ++i +(++i); printf("%d",num); }
Write a program to receive an integer and find its octal equivalent?
#define square(x) x*x main() { int i; i = 64/square(4); printf("%d",i); }
4 Answers Google, HCL, Quick Heal, WTF,
There are 21 people in a room. They have to form groups of 3 people each. How many combinations are possible? Write a C program to print the same.