array of unions in c
Hi lets suppose that we declare an array of unions'
union{ long lala; int myint; char mychar[30]; }myunion[40]; Is is possible to do the following myunion[1].lala=323434243; strcpy(myunion[2].char,"shit); and so on? |
Just try it, that's the best way to learn.
|
i have tried it and i think it works but still i am not sure
|
You have 1200 posts, probably most of them programming-related, but still don't know the basics about arrays and unions? And even more, it works, but you're not sure whether it works?
I hope I didn't hurt you... |
All times are GMT -5. The time now is 08:16 PM. |