![]() |
|
#1
|
|||
|
|||
Reading from fileHi, im trying to read data from a file to an array. The file is like this:
0 1 2 1 2 3 2 3 4 . . 10 11 12 i have dfined this variables: CPP / C++ / C Code:
but when i run the program, when the index i reaches 9 it shows a classic windows dialog stating "This program ... invalid operation ....close". When i define the array with 12 elements it works but i get extra elements like 12 345637373 0 534327437 (probably other memory data). Because i will use this array for some mathematical processing i need to have only the number of registers exactly, i mean if the file has 11 registers i need an array with 11 rows. This is because i don't know the number of registers a priori so i need to calculate the size of the array while processing. Can you help me with this? Thx in advance |
|
#2
|
||||
|
||||
Re: Reading from fileI know this is old, but the second dimension value of the array you are trying to read is 1 too short. You needed Data[11][3] to properly read your example data.
|
|
#3
|
||||
|
||||
Re: Reading from fileWhoa... pulling one out of the archive there aren't ya
__________________
If practice makes perfect and nobody's perfect... why practice? Homepage: http://www.treywhite.com Blog: http://www.treywhite.com/blog.php Web Design Company: http://www.ewebproductions.com |
Recent GIDBlog
Flickr uploads of IA pictures by crystalattice
| Thread Tools | Search this Thread |
| Rate This Thread | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Limited file size.... | lament | Apache Web Server Forum | 2 | 31-May-2004 13:35 |
| writing into file prob | belludandy | C Programming Language | 0 | 15-Nov-2003 19:25 |
| How to offer .tar.gz file downloads? | JdS | MySQL / PHP Forum | 6 | 14-Sep-2003 17:30 |
| How to search a huge text file for data? | JdS | MySQL / PHP Forum | 7 | 27-May-2003 09:27 |
| How Do i get php to find out the file type of a file for me? | viperman95833 | MySQL / PHP Forum | 2 | 08-Mar-2003 09:48 |
Network Sites: GIDNetwork · GIDWebHosts · GIDSearch · Learning Journal by J de Silva, The