struct Pos {
int x;
int y;
}
Pos initialPosition;
Pos importantPosition[3];
This kind of struct though can't be passed as argument of a function.
managed struct Pos {
int x;
int y;
}
Pos * initialPosition;
Pos * importantPosition;
//we can't use 'initialPosition = new Pos;' in the body, it needs to be in a function
function initialisePositions(){
initialPosition = new Pos;
importantPosition = new Pos[3];
importantPosition[0] = new Pos;
importantPosition[1] = new Pos;
importantPosition[2] = new Pos;
}
function moveDancingTo(Pos * destination){
// do something with destination
}
Managed strucs allow passing structs as parameters