![]() |
|
#1
|
|||
|
|||
contents of .txt file into 2D arrayhi guys...im trying to get the contents of a sudoku in a .txt file into an array sudoku[9][9]...feels really weird coz my program is about verifying a given soduko solution...basically im done with the whole algorithm of checking...and im stuck with stupid fscanf
the .txt file looks like this 1 2 3 4 5 6 7 8 9 4 5 6 7 8 9 1 2 3 7 8 9 1 2 3 4 5 6 2 3 4 5 6 7 8 9 1 5 6 7 8 9 1 2 3 4 8 9 1 2 3 4 5 6 7 3 4 5 6 7 8 9 1 2 6 7 8 9 1 2 3 4 5 9 1 2 3 4 5 6 7 8 and heres the code ive written...basically when i run it nothing happens...the compiler just keeps running... CPP / C++ / C Code:
Last edited by LuciWiz : 07-Apr-2008 at 08:23.
Reason: Please insert your C/C++ code between [cpp] & [/cpp] tags
|
|||
|
#2
|
|||
|
|||
Re: contents of .txt file into 2D arrayoh jeez...i figured it out...
i misplaced i with j in one place... the code does work... sorries guess the topic can be closed thank you |
|
#3
|
||||
|
||||
Re: contents of .txt file into 2D arrayActually, no it doesn't. There's still a bug. See this
__________________
The 3 Laws of the Procrastination Society: 1) Never do today that which can be put off until tomorrow 2) Tomorrow never comes |
|
#4
|
|||
|
|||
Re: contents of .txt file into 2D arraywell...my program runs perfectly...
yea i saw the link u posted...i get it... but this still runs... i get perfect outcomes... |
|
#5
|
|||
|
|||
Re: contents of .txt file into 2D arrayQuote:
Humor me: try the following: CPP / C++ / C Code:
Output: Code:
Scroll down the output that I show: it goes through the loops twice. Now, you might claim that, since you observe the answers you expected that it is working perfectly, and perhaps for your purposes it is satisfactory. However it is a very real bug, and if you get into the habit of ignoring bugs (like this or others that may be pointed out to you from time to time), well, that's your business. Others who read threads like this may be interested in knowing how to avoid bugs. For example CPP / C++ / C Code:
Regards, Dave Last edited by davekw7x : 10-Apr-2008 at 23:51.
|
Recent GIDBlog
Problems with the Navy (Officers) by crystalattice
| Thread Tools | Search this Thread |
| Rate This Thread | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Airport Log program using 3D linked List : problem reading from file | batrsau | C Programming Language | 11 | 29-Feb-2008 07:44 |
| How to use the data obtain in one C file to another C file? | TommyC | C Programming Language | 12 | 15-Jan-2008 09:51 |
| Need help deleting the last element in the array | headphone69 | C++ Forum | 2 | 15-Mar-2006 19:31 |
| After execution - Error cannot locate /Skin File? | WSCH | C++ Forum | 1 | 05-Mar-2005 20:03 |
| CD Buring Failed | skanth2000 | Computer Hardware Forum | 1 | 15-Nov-2003 03:52 |
Network Sites: GIDNetwork · GIDWebHosts · GIDSearch · Learning Journal by J de Silva, The