M
MatthewL
Hi,
I'm having a few problems using a strucutre.
struct iCoords
{
int X;
int Y;
};
iCoords myCoords[5] = {-1, -1};
myCoords[0].X = 325;
myCoords[0].Y = 240;
myCoords[1] = {225, 340};
I can initialize the struct fine with the first line of code, but there
after it complains.
For the second and third lines where I try to initialize the two X and Y the
compiler tells me I'm missing a ';' before '.'.
One the fouth line the compiler tells me I have too many initializers.
Can anyone explain what I'm doing wrong here please?
I'm having a few problems using a strucutre.
struct iCoords
{
int X;
int Y;
};
iCoords myCoords[5] = {-1, -1};
myCoords[0].X = 325;
myCoords[0].Y = 240;
myCoords[1] = {225, 340};
I can initialize the struct fine with the first line of code, but there
after it complains.
For the second and third lines where I try to initialize the two X and Y the
compiler tells me I'm missing a ';' before '.'.
One the fouth line the compiler tells me I have too many initializers.
Can anyone explain what I'm doing wrong here please?