I just started leaning c programming, and i have been doing alright, but now am stuck with a problem, I do not know how to read information from a file in c. the file contains info like;
123456789123456789123456789123456789...and so on. i have to read the file in, and then group the numbers in the file into 7, make them a coulumn matrix and multipy each of the column matrix with another matrix. ive written the code to multiply two matrixs and it works, i just dont know how to group the numbers into groups of 7 and make them a colum matrix like below.
1 1 1
2 2 2
3 3 3
4 4 4
5 5 5
6 6 6
7 7 7
8 8 8
9 9 9
cesione 0 Newbie Poster
Recommended Answers
Jump to PostMost of the time "I don't know" is not an attenuation for lack of effort in this forum.
If you don't know, try to lean, and prove at least, what effort you have done in such endeavor. Anything else would be an aggravation against your cause.
Jump to PostPost the relevant part of the code you have worked with.
Jump to Post>>123456789123456789123456789123456789
Does the file actually look like that -- just a bunch of numbers with no separation between them?
Jump to Postgroup the numbers in the file into 7
Into 7 what, seven columns per row, seven rows, seven digits per column, seven digits per row?
Show an example: Input, and what you need for your array. Your description leaves a lot to be desired. An example would serve much …
All 15 Replies
Aia 1,977 Nearly a Posting Maven
cesione 0 Newbie Poster
Aia 1,977 Nearly a Posting Maven
Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster
Adak 419 Nearly a Posting Virtuoso
cesione 0 Newbie Poster
cesione 0 Newbie Poster
Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster
cesione 0 Newbie Poster
Adak 419 Nearly a Posting Virtuoso
cesione 0 Newbie Poster
cesione 0 Newbie Poster
cesione 0 Newbie Poster
Adak 419 Nearly a Posting Virtuoso
Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.