Does any buddy tell me use of asterik in C++ ?? And also explain use of static in methods and in constructors. Actually I am search a code that dynamically creates an object of class.
Anyone please help !
class BoxFactory
{
public:
static Box *newBox(const std::string &description) //expalin this line of code please
{
if (description == "pretty big box")
return new PrettyBigBox;
if (description == "small box")
return new SmallBox;
return 0;
}
};