Go4Expert

Go4Expert (http://www.go4expert.com/)
-   C (http://www.go4expert.com/forums/c/)
-   -   Problem with variables. (http://www.go4expert.com/forums/problem-with-variables-t25722/)

oror84 6May2011 15:46

Problem with variables.
 
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.

xpi0t0s 7May2011 14:07

Re: Problem with variables.
 
sprintf might do the job, or itoa, depending on exactly how you want to do it.


All times are GMT +5.5. The time now is 01:32.