![]() |
|
#1
|
|||
|
|||
sorting numbers through arrayi have problem with sorting numbers through array. pls help me...
requirements: 1. the user will input an array of 10 numbers. 2. a menu will appear after the input has done. and you will choose either the numbers will appear in ascending or descending order. here's the code and i don't know if its correct CPP / C++ / C Code:
|
|||
|
#2
|
||||
|
||||
|
Quote:
You call the sort function with the second parameter being an int (I think; maxsize is an int, right?). But your function expects an address to an int: CPP / C++ / C Code:
That is the problem. When you call it the second time, you won't get an error, because that is correct (syntactically). Decide what you are trying to do, and then perform the appropriate changes. Kind regards, Lucian __________________
Please read these Guidelines before posting on the forum "A person who never made a mistake never tried anything new." Einstein |
|
#3
|
|||
|
|||
|
The problem with the original code is probably as simple as this:
Quote:
seems that the "x[ctr]" is merely a typing accident and if written simply "x" the whole problem goes away. But when I am writing this the topic is already 2 days old and probably expired already. This forum is just too quiet I guess. |
|
#4
|
||||
|
||||
|
Quote:
Man, did I mess up! I was in such a rush, I misquoted the function headers, and got it all wrong. Thanks, maprich for correcting my mistake. Best regards, Lucian __________________
Please read these Guidelines before posting on the forum "A person who never made a mistake never tried anything new." Einstein |
Recent GIDBlog
Not selected for officer school by crystalattice
| Thread Tools | Search this Thread |
| Rate This Thread | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Help with an array using pointers | glulu76 | C++ Forum | 1 | 01-May-2005 11:21 |
| duplicate numbers in array? | njypa | C++ Forum | 1 | 27-Feb-2005 16:08 |
| template comiling problems - need expert debugger! | crq | C++ Forum | 1 | 01-Feb-2005 21:26 |
| Sorting a 2D array c++ | mike3340 | C++ Forum | 4 | 15-Dec-2003 13:35 |
Network Sites: GIDNetwork · GIDWebHosts · GIDSearch · Learning Journal by J de Silva, The