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() { extern out; printf("%d", out); } int out=100;
write a simple calculator c program to perform addition, subtraction, mul and div.
0 Answers United Healthcare, Virtusa,
What are the files which are automatically opened when a C file is executed?
Can you send Code for Run Length Encoding Of BMP Image in C Language in linux(i.e Compression and Decompression) ?
main( ) { int a[ ] = {10,20,30,40,50},j,*p; for(j=0; j<5; j++) { printf(“%d” ,*a); a++; } p = a; for(j=0; j<5; j++) { printf(“%d ” ,*p); p++; } }
What is wrong with the following code? int *foo() { int *s = malloc(sizeof(int)100); assert(s != NULL); return s; }
Given n nodes. Find the number of different structural binary trees that can be formed using the nodes.
16 Answers Aricent, Cisco, Directi, Qualcomm,
main() { int i=5; printf("%d",++i++); }
char *someFun1() { char temp[ ] = “string"; return temp; } char *someFun2() { char temp[ ] = {‘s’, ‘t’,’r’,’i’,’n’,’g’}; return temp; } int main() { puts(someFun1()); puts(someFun2()); }
void ( * abc( int, void ( *def) () ) ) ();
main() { char p[ ]="%d\n"; p[1] = 'c'; printf(p,65); }