Go4Expert

Go4Expert (http://www.go4expert.com/)
-   C (http://www.go4expert.com/forums/c/)
-   -   how to loop in C (http://www.go4expert.com/forums/loop-c-t8414/)

rico_dee2000 23Jan2008 07:27

how to loop in C
 
Could anyone help me how to loop this (using for loop)?
please help!!!!!!!!
Thanks.
please help me by giving the axact code...


D3CT01_WK.fmtemp[1].ctl1[0] = data->NSTblEx1_1_0;
D3CT01_WK.fmtemp[1].ctl1[1] = data->NSTblEx1_1_1;
D3CT01_WK.fmtemp[1].ctl1[2] = data->NSTblEx1_1_2;
D3CT01_WK.fmtemp[2].ctl1[0] = data->NSTblEx1_2_0;
D3CT01_WK.fmtemp[2].ctl1[1] = data->NSTblEx1_2_1;
D3CT01_WK.fmtemp[2].ctl1[2] = data->NSTblEx1_2_2;
D3CT01_WK.fmtemp[3].ctl1[0] = data->NSTblEx1_3_0;
D3CT01_WK.fmtemp[3].ctl1[1] = data->NSTblEx1_3_1;
D3CT01_WK.fmtemp[3].ctl1[2] = data->NSTblEx1_3_2;
D3CT01_WK.fmtemp[4].ctl1[0] = data->NSTblEx1_4_0;
D3CT01_WK.fmtemp[4].ctl1[1] = data->NSTblEx1_4_1;
D3CT01_WK.fmtemp[4].ctl1[2] = data->NSTblEx1_4_2;

pradeep 23Jan2008 12:10

Re: how to loop in C
 
You'll need to try at least then we can try to help you out if you are stuck somewhere, do post your code for reference.
Tip: Use nested loops.

asadullah.ansari 23Jan2008 14:01

Re: how to loop in C
 
Code:

for(i=1;i<=4;++i)
{
  for(j=0 ;j<=2;++j)
  {
      D3CT01_WK.fmtemp[i].ctl1[j] = data->NSTblEx[1][i][j];
  }
}


asadullah.ansari 23Jan2008 14:02

Re: how to loop in C
 
Can you tell what is exactly problem??

shabbir 23Jan2008 15:33

Re: how to loop in C
 
asadullah.ansari, please use code block when you have code snippets in the posts


All times are GMT +5.5. The time now is 09:05.