By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
445,851 Members | 2,097 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 445,851 IT Pros & Developers. It's quick & easy.

Read text file in columns?

P: 2
Hello
i badly want to read a textfile.txt into an array in way that i will use the values to compute something.The text file has 4x4 (column by row.) of double type values.
Pliz help.
Thank.
Mar 9 '07 #1
Share this Question
Share on Google+
1 Reply


Ganon11
Expert 2.5K+
P: 3,652
You have 16 double values in your text file, and you want to read them into a 4x4 array?

Use a set of nested for...loops - one for the rows, and one for the columns - and in each execution of the inner loop, read data from the file into the (r, c)th element of the index (r = rows, c = columns).
Mar 9 '07 #2

Post your reply

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