I have a file and I want to read the information which is in it, buy I want to make the information be like an array (A[100][100]). How can I do it.
4 replies to this topic
#1
Posted 05 April 2011 - 03:36 AM
|
|
|
#2
Posted 05 April 2011 - 04:08 AM
C or C++? Concept is the same, only other functions/methods are used.
A conclusion is where you got tired of thinking.
#define class struct // All is public.
#3
Posted 05 April 2011 - 04:34 AM
C. Thanks.
#4
Posted 05 April 2011 - 05:33 AM
You'll need a pointer to FILE structure, open it with fopen, check whether pointer is NULL (missing file, name mismatch) and then reading begins. You can read whole lines (to '\n' character) with fgets or you can read words (up to first white space) with fscanf. Also, when you're done don't forget to close the file.
A conclusion is where you got tired of thinking.
#define class struct // All is public.
#5
Posted 05 April 2011 - 08:11 AM
How can I make the program recognize that the information in the file is matrix?
1 user(s) are reading this topic
0 members, 1 guests, 0 anonymous users


Sign In
Create Account


Back to top









