I’m trying to create a array of structs, but define it’s size later, like so:
struct xy{
int x;
int y;
};
int main(){
xy pos;
int size = 10;
pos = new xy[size];
pos[0].x = 5;
}
But I can’t get it to work no matter what I try. Also I don’t want to use a vector for this, so please don’t say I should.
newreturns a pointer: