![]() |
|
#1
|
|||
|
|||
C league tableHello!
I have been given an assignment to create a league table in C. Basically a series of match results are to be entered by the user and an updated league table is to be produced. Which looks something like this: P W D L F A T Galatasaray 2 1 1 0 4 3 4 Juventus 2 0 2 0 3 3 2 Rosenborg 2 0 2 0 2 2 2 Atlentico 2 0 1 1 2 3 1 I am uber new to this whole programming thing, my teacher here at uni is terrible, and I am really confused. I have spent hours trying to figure this out but so far all I have come up with is the main menus etc (which i am dead proud of!!!). I have also made an array for the team names which I can now add one at a time, and I figured that I have to make a 2d array for the scores part. At this point we don't have to worry about sorting them in any particular order, just trying to get it to display ^like that is hard enough. Does anyone have any ideas how this could be done, and how I could display this table. Any help would be really appreciated as I am going nuts and have my first demo soon :-? Thanks very much for taking the time to read this. Edd 8-) P.S: another thing: when I add a new team to the array, and display it, it shows a whole bunch of other stuff in the places where there aren't teams. Someone told me that, that is what was in memory before, but I cannot clear it. Any ideas? |
|||
|
#2
|
|||||
|
|||||
|
Quote:
Quote:
Quote:
Quote:
Basically you will need two nested loops to accomplish this task. For example: CPP / C++ / C Code:
Quote:
When any variable is defined in C/C++ the variable is not cleared to a known value unless it's global. So whatever happened to be in that memory location the variable is now defined at is the initial value of the variable. It's literally junk and needs to be cleared if you plan on using it without loading it, or just don't use it until it has been loaded with data. __________________
The 3 Laws of the Procrastination Society: 1) Never do today that which can be put off until tomorrow 2) Tomorrow never comes |
|
#3
|
|||
|
|||
CodeHi there,
Thanks for the swift reply, sorry about not posting the source code, silly of me ![]() Cheers for your help, I appreciate it immensely Edd CPP / C++ / C Code:
Last edited by LuciWiz : 26-Mar-2006 at 10:41.
Reason: Please insert your C code between [c] & [/c] tags
|
|
#4
|
||||
|
||||
|
Quote:
__________________
The 3 Laws of the Procrastination Society: 1) Never do today that which can be put off until tomorrow 2) Tomorrow never comes |
Recent GIDBlog
Problems with the Navy (Enlisted) by crystalattice
| Thread Tools | Search this Thread |
| Rate This Thread | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Help with simple math table program (was a SIMPLE program) | Bubba | C Programming Language | 3 | 09-Mar-2005 12:40 |
| Hash Table & Graph | Kay Chan | C++ Forum | 7 | 08-Oct-2004 07:44 |
| Search data in table. | eRIC | MySQL / PHP Forum | 2 | 16-May-2004 03:06 |
| customizing preprocessor and hash table | incognito54 | C Programming Language | 2 | 21-Apr-2004 18:25 |
| [Tutorial] MySQL Basics | nniehoff | MySQL / PHP Forum | 15 | 23-Mar-2003 19:42 |
Network Sites: GIDNetwork · GIDWebHosts · GIDSearch · Learning Journal by J de Silva, The