So, into the Arrays section of the C Primer Plus, Fifth Edition book i'v run into a snag. While the book "briefly" (And I mean VERY briefly) touches on Arrays, it makes no real mention of how you would actually take user input and place it into each element of an Array.
Say I wanted to take 10 integers from the user and have it store them into
int num[10];
How would I go about doing this? I'v tried using a FOR loop, but most of the time all it's doing is outputting::
1, 2, 4, 6, 8, 10
or
1, 3, 5, 7, 9
And those are with the user values being 1 2 3 4 5 6 7 8 9 and 10. Anyone help me with this and explain what exactly I need to do to get an array to take user input.
Thanks in advance.