hi,
i want to declare a CArray in my prog. The array is meant to contain elements of the type CProducten (a class that i made myself) Am i doing this correct :
if you say array[100], that means you want one hundred arrays. Remember a CArray is different from the basic array type.
Rather, use SetSize to initialize the size of the collection (not absolutely necessary, but faster to allocate a whole bunch of memory at once.)
Also note that I change the second template argument to [tt]CProducten&[/tt]. This is to keep the entire CProducten object from having to be pushed onto the stack in function calls... instead only a reference is returned.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.