Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

dbwrobel

Guest
Original poster
May 11, 2010
63
0
I'm trying to make a multidimensional array and I'm following a sample that I found online and can't seem to get it to work in Xcode. Here is the form I used in the variable declaration:

double tcoord[3][3] = {
{
-70,70,-10.6789
}
{
-61.2525,-70,-23.9652
}
{
28.5760,-23.9126,-19.4531
}
};

I get an error saying "Expected '}' before '{' token"

Any ideas?
 
making a multidimensional array

I'm trying to make a multidimensional array and I'm following a sample that I found online and can't seem to get it to work in Xcode. Here is the form I used in the variable declaration:

double tcoord[3][3] = {
{
-70,70,-10.6789
}
{
-61.2525,-70,-23.9652
}
{
28.5760,-23.9126,-19.4531
}
};

I get an error saying "Expected '}' before '{' token"

Any ideas?

Add commas to after every '}' (not for last one).

double tcoord[3][3] = {
{
-70,70,-10.6789
},
{
-61.2525,-70,-23.9652
},
{
28.5760,-23.9126,-19.4531
}
};
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.