
Exercises 573
Explanation: In the above program, the pointers i, s, f, and l of int, char, float, and long
type are declared, respectively. The character variable choice is declared. The program prompts
the user to enter his/her choice. The switch() case executes the appropriate case accord-
ing to the user choice. By using new operators, memory is allocated to the respective pointers
and again, the program prompts the user to enter data. The data and choice entered by the user
are passed to function show(). The function show() contains void pointers. In function
show(), the type of void pointer is changed to char, long, int, and ...