Home     |     .Net Programming    |     cSharp Home    |     Sql Server Home    |     Javascript / Client Side Development     |     Ajax Programming

Ruby on Rails Development     |     Perl Programming     |     C Programming Language     |     C++ Programming     |     IT Jobs

Python Programming Language     |     Laptop Suggestions?    |     TCL Scripting     |     Fortran Programming     |     Scheme Programming Language

Cervo Technologies
The Right Source to Outsource

MS Dynamics CRM 3.0

C++ Programming

converting String to a type name

Hello Friends,

The problem is that i get the names of the object type dynamically at
the run time as a string name to a function. Now this function is
suppose to create an object of the type name specified as the string
to the function. (Suppose we already have a class declared by that
name specified)

For e.g.

class ABC


int main() {
        string k = "ABC" ;

        // k * a = new k ; how to implement this??

        return 0;


Thanks a lot,

Use a std::map of std::string and a helper object that creates the
objects for each name.  This assumes the types have a common base.

Ian Collins.

Add to del.icio.us | Digg this | Stumble it | Powered by Megasolutions Inc