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 |
How to count a sum, when the numbers are read from stdin and stored into a structure?
main() { char *p; p="%d\n"; p++; p++; printf(p-2,300); }
main() { int i=10,j=20; j = i, j?(i,j)?i:j:j; printf("%d %d",i,j); }
int i,j; for(i=0;i<=10;i++) { j+=5; assert(i<5); }
¦void main() ¦{ ¦int i=10,j; ¦ j=i+++i+++i; ¦printf("%d",j); ¦getch(); ¦} ¦ output:-30 but in same question if we write as- ¦void main() ¦{ ¦int i=10; ¦ int j=i+++i+++i; ¦printf("%d",j); ¦getch(); ¦} ¦ output:-33 why output is changed from 30 to 33. Can any body answer...
main() { struct date; struct student { char name[30]; struct date dob; }stud; struct date { int day,month,year; }; scanf("%s%d%d%d", stud.rollno, &student.dob.day, &student.dob.month, &student.dob.year); }
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
main() { int i; printf("%d",scanf("%d",&i)); // value 10 is given as input here }
main() { char p[ ]="%d\n"; p[1] = 'c'; printf(p,65); }
Finding a number which was log of base 2
How do you verify if the two sentences/phrases input is an anagram using predefined functions in string.h and by using arrays?
main() { while (strcmp(“some”,”some\0”)) printf(“Strings are not equal\n”); }