When creating a new object, i can't decide to use "static allocation" or "dynamic allocation".
Ex:
class A
{...};
int main()
{
// A theObject;
// or A theObject = new A(); ?
} In some more complex cases, i don't know what i should do.
Ex:
Use this:
vector<vector<Student>> a; Or this:
vector<vector<Student *>> a; accompanied by
a.resize(someSize);
for(i = 0; i < (int)a.size(); ++i)
a[i] = new Student(); Please explain to me how to use them properly. Thanks thousands.