恳请高手指点一下,这个循环怎么不行呢!
const int snum=9;for (int i=1;i<snum;i++)
{
snakelink[i].length = slength;//每节蛇的长度
snakelink[i].radius= sradius;//半径
snakelink[i].mass = smass;//质量
snakelink[i].body = dBodyCreate(world);
dMassSetZero(&m1);
dsSetColor(0.0,1.0,0.0);
dsDrawCylinder(dBodyGetPosition(snakelink[i-1].body),dBodyGetRotation(snakelink[i-1].body),snakelink[i].length,snakelink[i].radius);
dMassSetCylinderTotal(&m1,snakelink[i].mass,1,snakelink[i].radius, snakelink[i].length);
dMassSetBoxTotal(&m1,snakelink[i].mass,snakelink[i].length, snakelink[i].radius,snakelink[i].radius);
}