![]() |
|
#1
|
|||
|
|||
Problem in arrayI want to store the starting port in an array. If the starting ports exists in the array, then it won't be stored. However, I'm in trouble about scanning. When the starting port exists in the array, then the loop stops. The txt file is:
ABC FFF 1 DEF FFF 2 ABC FFF 2 <---after loading this, the program is stopped. GTH FFF 2 FTR FFF 2 KOJ FFF 2 DEF FFF 2 How to make it keep going and ignore the duplicate name ? CPP / C++ / C Code:
Last edited by dsmith : 05-Oct-2004 at 07:07.
Reason: Please use [c] & [/c] for syntax highlighting
|
|
#2
|
|||
|
|||
|
Quote:
What is the return value when the comparison fails? Didn't your compiler give any warnings? You should put CPP / C++ / C Code:
after the loop. However, I can't see how this would cause your program to hang up. You are also not using feof() properly, but that couldn't cause the program to hang up either. I would have to see more of your program to try to see what's happening. Here's a question: Have you allocated storage for all of the struct elements? Let's see the struct definition and initialization of ports. Regards, Dave |
|
#3
|
||||
|
||||
|
Check the tutorial section for aaron's tutorial on I/O and look at the feof() entry. That will (hopefully) explain why you aren't using feof() properly.
__________________
Age is unimportant -- except in cheese |
Recent GIDBlog
Meeting the local Iraqis by crystalattice
| Thread Tools | Search this Thread |
| Rate This Thread | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Debugging problem.... | Max | C Programming Language | 4 | 04-Aug-2004 04:59 |
| Speed up C++ code about 3d array! | Truong Son | C++ Forum | 0 | 16-Mar-2004 21:52 |
| Extra null element in an array | samtediou | MySQL / PHP Forum | 2 | 11-Dec-2003 11:52 |
| Problem with array | norok | MySQL / PHP Forum | 3 | 16-Jul-2003 02:08 |
Network Sites: GIDNetwork · GIDWebHosts · GIDSearch · Learning Journal by J de Silva, The