Dynamic variable type definition
Hi,
Question: Is there a way do dynamically define a variable?
Example:
given a number i decide will my next number be defined as 16, 32 or 64 bit integer.
in c i can do that with helper functions and macros. I probably can do the same thing here in c++, but is there maybe an alternative c++ way?
Code:
int a = 300;
if a> 255
// b should be defined as 32 bit integer
if a > 2^32
// b should be defined as 64 bit integer
// initialize b
// then pass this b into some function template that can handle 32 and 64 bit integers
thank you
baxy