>But what I can't seem to access is the constructor.
This is where the C memory functions fall flat, they don't work well with constructors and destructors. I recommend ditching calloc and using new[]:
CObject *group = new CObject[N];
Or better yet, use the vector container class if you plan on resizing the collection:
#include <vector>
...
std::vector<CObject> group ( 1 ); // Start off with 1 element
Narue
Bad Cop
15,460 posts since Sep 2004
Reputation Points: 6,464
Solved Threads: 1,401
The calloc (and malloc) function never calls constructors; free() never calls destructor(s).
So using new and delete operators for class objects (or array of class objects) is not only recommendation or a good style symptom - it's one of the very strict C++ language specifications.
ArkM
Postaholic
2,001 posts since Jul 2008
Reputation Points: 1,234
Solved Threads: 348