471,873 Members | 1,710 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,873 software developers and data experts.

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 3501
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 zermasroor | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.