I want to create an array of objects with non-default Constructor. Please note that I am not allowed to use vector from STL, I made a research on this and found a method:
Obj* p_obj[3];// for an array of 3 for example
// then allocate to each pointer using new
p_obj[0] = new Obj(10);
p_obj[1] = new Obj(15);
p_obj[2] = new Obj(20);
though when I am trying to create a bigger array(100 elements), my program goes segFault. I would appreciate if someone would advice me a good solution for this problem.
Thank you in advance!