for(int i=0; i<3; i++){
switch(i)
case 0:
LAYOUT[i].x=i;
LAYOUT[i].y=i;
case 1:
LAYOUT[i].x=funcx(i);
LAYOUT[i].y=funcy(i);
case 2:
LAYOUT[i].x=2*i;
LAYOUT[i].y=4*i;}
This is the simplified code I am having problem with. What I want this code to do is, when i=0, do whats in case 0, when i=1, do whats in case 1 and so on.
But here is the problem.. for example when i=1, it calculates the correct .x (case 1) value but for .y it calculates for a different i such as 0 or 2. I tried to put {} around all the code inside each case, but it made no difference. I also tried i from 1 to 3 instead..
ofstream Zone1H;
Zone1H.open("TEST.txt");
for(int l=0; l<5; l++)
Zone1H<<LAYOUT[i].x<<" "<<LAYOUT[i].y<<endl;
Could my saving part be the issue? I never had problem with this part though..
break
between the cases, so it's falling through to the next case.switch(i) { ... }
Those are not optional.