Is it possible to store elements with different data types in an aeeay?
> Is it possible to store elements with different data types in a C++ array?
Short answer: No.
Longer answer: Depends on what you mean by 'different data type'
In a C++ array the static (or compile-time) type of every element in an array would be the same.
However, if the element is a (discriminated) union or a pointer to a polymorphic type, the dynamic (or run-time) type could be different for different elements.