Can I Variable-ize Data Type Declarations?

Exploration question. Let's say for some reason I wanted a variable called "reading" to sometimes be a bool and other times to be an int or float or some other data type. Perhaps for a program to autodetect and adapt to hardware settings.

Can I use a variable in place of the data type declaration? Something where a variable represents other possible words instead of numbers and still be intelligible to the code (probably rules out strings/char arrays?)

dataType declared somehow, then:

if (switchState == 1)
dataType = bool;
if (switchState == 0)
dataType = int;

dataType reading;

Maybe you are thinking of a UNION.

.

Yeah, if C were Forth, no problem.