Point V[rows];
Is this allowed in C++? rows is a variable whose value is given at runtime and Point is my class.
Point V[rows];
Is this allowed in C++? rows is a variable whose value is given at runtime and Point is my class.
Only in C99 - it's a new feature called "variable length arrays". Normally, no.
I would strongly recommend against using this feature. If you have to do it, either use alloca, or allocate them properly, i.e. Point *V = new Point V[rows];.
BTW: Many people discourage Alloca as well. See here.
Point *V = new Point[rows];, obviously.