Problem with variables.

oror84's Avatar, Join Date: Jan 2011
Light Poster
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.
0
xpi0t0s's Avatar, Join Date: Aug 2004
Mentor
sprintf might do the job, or itoa, depending on exactly how you want to do it.