Problem with variables.

Light Poster
6May2011,15:46   #1
oror84's Avatar
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.
Mentor
7May2011,14:07   #2
xpi0t0s's Avatar
sprintf might do the job, or itoa, depending on exactly how you want to do it.