Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

File In/Out 2

Status
Not open for further replies.

davebh

Programmer
Feb 16, 2005
7
0
0
GB
I have populated an 'array1[x][y]' with type int.
I have opened a FileStream and written the array
to "output.txt".
The values in "output.txt" are seperated by spaces.
I now want to read in the values in order to populate
array2[x][y].
I am having difficulty in doing so, can the fn()'s defined like ReadLine(), Read() or ReadBlock() be used as desired.
 
{if;) You can write an array to a file stream. What's a problem in read it back?..
 
I realise that reading back in the data should be no problem but how is it done? The functions I have mentioned don't do what I desire.
 
Well I checked MS Visual Studio 6 and ReadBlock does not exist as a function. ReadLine is a Visual basic scripting edition command. The fact (?) that your program is compiling successfully suggests that you are using a different compiler.

If such basic functions are not working correctly then you need to highlight the command(s) and F1 to get the context sensitive help, which you should read very carefully.

One thing to watch out for. This I/O function may well require a "this" pointer which you are not correctly supplying. Remember that the "this" pointer is only implicitly available within member functions of the class.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top