I want to copy selected elements from array stdC to total,
but instead I only get the same three numbers every time, can you help me?
thanks
Code:
#include <stdio.h>
int main()
{
int i,j,k;
float stdC[12][3]={
{-4.859,0.073,0.122},
{-3.610,-0.654,0.017},
{-2.432,0.308,0.088},
{-2.621,1.515,0.217},
{-1.213,-0.231,0.004},
{-0.016,0.584,0.061},
{0.794,0.422,-1.218},
{1.222,-0.680,-1.549},
{1.005,1.527,-1.937},
{1.760,1.497,-3.174},
{1.839,2.893,-3.777},
{1.303,3.846,-3.217},
};
float total[28][3];
for(i=0;i<28;i++)
for(j=0;j<3;j++)
total[i][j]=0;
for(i=16;i<20;i++)
for(j=0;j<3;j++)
for(k=4;k<8;k++)
total[i][j]=stdC[k][j];
for(k=0;k<28;k++)
{
{
for(j=0;j<3;j++)
printf("test %.3f\t",total[k][j]);
printf("\n");
}
}
return 0;
}