- 5
Fill in the blanks to declare an array of void pointers to x1, x2 and x3 and print them using the pointers.
int x1 = 42; float x2 = 3.14; char x3 = 'a'; void* arr[] = {&x1, &x2, ---- x3}; ---------("%d %f %c", *(( ------ *)arr[0]), ( (-------- *)arr[1]), *(( ------- *)arr[2]));
6 Answers
+ 2
int x1 = 42;
float x2 = 3.14;
char x3 = 'a';
void* arr[] = {&x1, &x2, &x3};
Printf ("%d %f %c",
*(( int *)arr[0]),
*(( float *)arr[1]),
*(( char *)arr[2]));
0
int x1 = 42;
float x2 = 3.14;
char x3 = 'a';
void* arr[] = {&x1, &x2, &x3};
Printf ("%d %f %c",
*(( int *)arr[0]),
(( float *)arr[1]),
*(( char *)arr[2]));
0
this is Q&A DISCUSSION section bro , post this to " feed " section !
0
0
All is correct except for (Printf ("%d %f %c",
)
write printf in lower case
0
What is the output of the following code snippet?
int x1 11, x2 22, x3 = 12; =
x1 = x2++;
x2 = -x3;
x3 = x1+x2+x3+++x2++;
cout << x1 << x2 << x3;
(a) 221255
(b) 221155
(c) 221256
(d) 221156