C++ related
-
Hi ! I want to create array of objects of a certain class like: CMyclass object[12]; But i want to intantiate these objects using one argument constructor of CMyClass. Is this possible or i've to create objects on heap ???
-
Hi ! I want to create array of objects of a certain class like: CMyclass object[12]; But i want to intantiate these objects using one argument constructor of CMyClass. Is this possible or i've to create objects on heap ???
Initialize the array in the following way:
CMyclass object[12] = { CMyclass(argument), CMyclass(argument), CMyclass(argument), ..., CMyclass(argument) };
-
Initialize the array in the following way:
CMyclass object[12] = { CMyclass(argument), CMyclass(argument), CMyclass(argument), ..., CMyclass(argument) };
or, if you use stl, std::vector objects; objects.resize( 12, CMyClass(argument) ); ¡El diablo está en mis pantalones! ¡Mire, mire! Real Mentats use only 100% pure, unfooled around with Sapho Juice(tm)!