Sameer_Thakur wrote:
how can I create an array/object of same data type at runtime?
AFAIK, there's no way to do this directly in C++. You can, however, design a system of classes that are capable of creating/cloning themselves at runtime and/or being created by type. For an example implementation, check out the source code for MFC's CRuntimeClass and CObject classes and the DECLARE_DYNAMIC/IMPLEMENT_DYNAMIC macros. This implementation has a common base class which includes methods for runtime object creation based on a class name. Because C++ has no built-in way to do this, the CRuntimeClass implements a list that maps class names to creator functions. Depending on the source of your source arrays, serialization may be useful as well. Regardless, at the heart of these solutions is code that creates objects of a specific class, which is all that C++ allows. Just my 2-cents, Mark
"Posting a VB.NET question in the C++ forum will end in tears." Chris Maunder