Fill in the blanks to declare an array of void pointers to x1, x2 and x3 and print them using the pointers. | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
- 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]));

11th May 2021, 8:25 PM
Arqum Farooq
Arqum Farooq - avatar
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]));
25th Jan 2022, 4:50 PM
MARKA SAI TEJA GOUD
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]));
11th May 2021, 8:32 PM
Arqum Farooq
Arqum Farooq - avatar
0
this is Q&A DISCUSSION section bro , post this to " feed " section !
12th May 2021, 12:43 AM
Giriraj Yalpalwar
Giriraj Yalpalwar - avatar
0
3rd Jan 2022, 2:57 PM
Kota Sunil Kumar Reddy
0
All is correct except for (Printf ("%d %f %c", ) write printf in lower case
23rd Aug 2023, 10:15 PM
mohamad eldimardash
mohamad eldimardash - avatar
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
7th Oct 2023, 6:39 AM
Beera Priya
Beera Priya - avatar