how to loop in C

Discussion in 'C' started by rico_dee2000, Jan 23, 2008.

  1. rico_dee2000

    rico_dee2000 New Member

    Joined:
    Jan 23, 2008
    Messages:
    1
    Likes Received:
    0
    Trophy Points:
    0
    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;
     
  2. pradeep

    pradeep Team Leader

    Joined:
    Apr 4, 2005
    Messages:
    1,645
    Likes Received:
    87
    Trophy Points:
    0
    Occupation:
    Programmer
    Location:
    Kolkata, India
    Home Page:
    http://blog.pradeep.net.in
    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.
     
  3. asadullah.ansari

    asadullah.ansari TechCake

    Joined:
    Jan 9, 2008
    Messages:
    356
    Likes Received:
    14
    Trophy Points:
    0
    Occupation:
    Developer
    Location:
    NOIDA
    Code:
    for(i=1;i<=4;++i)
    {
      for(j=0 ;j<=2;++j)
      {
          D3CT01_WK.fmtemp[i].ctl1[j] = data->NSTblEx[1][i][j]; 
       }
    }
    
     
    Last edited: Jan 23, 2008
  4. asadullah.ansari

    asadullah.ansari TechCake

    Joined:
    Jan 9, 2008
    Messages:
    356
    Likes Received:
    14
    Trophy Points:
    0
    Occupation:
    Developer
    Location:
    NOIDA
    Can you tell what is exactly problem??
     
  5. shabbir

    shabbir Administrator Staff Member

    Joined:
    Jul 12, 2004
    Messages:
    15,345
    Likes Received:
    382
    Trophy Points:
    83
    asadullah.ansari, please use code block when you have code snippets in the posts
     

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice