1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Problem with variables.

Discussion in 'C' started by oror84, May 6, 2011.

  1. oror84

    oror84 New Member

    Joined:
    Jan 15, 2011
    Messages:
    5
    Likes Received:
    0
    Trophy Points:
    0
    Hi,
    i have some array of structs.
    the struct have : char job[max]; int number;
    i need to get numbers from the user and get the numbers to the struct with the names w1,w2,w3,etc.
    i dont understand how can i do it.
    how can i link between the "w" and the number (1,2,3).
    i cant with strcat.
    i will glad if someone can help me.
    Thanks.
    Or.
     
  2. xpi0t0s

    xpi0t0s Mentor

    Joined:
    Aug 6, 2004
    Messages:
    3,012
    Likes Received:
    203
    Trophy Points:
    0
    Occupation:
    Senior Support Engineer
    Location:
    England
    sprintf might do the job, or itoa, depending on exactly how you want to do it.
     

Share This Page