468,512 Members | 1,487 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 468,512 developers. It's quick & easy.

storing word from a file into 2d array

16
hello,
i am having trouble storing word from a text file into a 2d array in C. the array size is 20 by 20 and i am required to store one word in each row. For some reason i don't get how to use a nested for loop to switch to next row after reading the first word.
This program is for sorting the words lexicographically into another text file.I am not allowed to use string header for this.
any help would be appreciated
thanks
Oct 3 '06 #1
1 3361
D_C
293 100+
I'm not sure exactly how you mean to traverse the array, an example would have helped. I assume you want to go across one row, then across the next row, until the last row.
Expand|Select|Wrap|Line Numbers
  1. for(int row = 0; row < NUM_ROWS; row++)
  2.    for(int col = 0; col < NUM_COLS; col++)
Oct 3 '06 #2

Post your reply

Sign in to post your reply or Sign up for a free account.

Similar topics

3 posts views Thread by Noam Dekers | last post: by
2 posts views Thread by David Horowitz | last post: by
10 posts views Thread by deciacco | last post: by
reply views Thread by NPC403 | last post: by
1 post views Thread by fmendoza | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.