![]() |
|
#1
|
|||
|
|||
input sorting programHello I have a code that works very well when I asign values to my array, but when I set it for the user to input the values the program crashes.
Here is my code: CPP / C++ / C Code:
As my note states I have found that the problem must be with the algorithm. I found this by taking it out to see if the input was being stored and it is. Thank you for any help Gene Saika |
|||
|
#2
|
|||
|
|||
Re: input sorting programQuote:
|
|
#3
|
|||
|
|||
Re: input sorting programThe array's size is 11 it has 10 elements and I was confused about how each element was being asigned. My first thought was " shouldn't there be something telling this program that each number is a new element?," but I couldn't find the way to do it and after having many people look over it I feel comfortable saying that this is not likely the issue, these people would include many classmates and my teacher.
|
|
#4
|
|||||
|
|||||
Re: input sorting programQuote:
Quote:
If you want the array to have 11 elements where they are all initialized to zero, use the following: CPP / C++ / C Code:
Quote:
Quote:
Quote:
So to answer your question about how to write to each element within an array, treat each element separately: CPP / C++ / C Code:
Last edited by ocicat : 21-Nov-2008 at 20:13.
|
|
#5
|
|||
|
|||
Re: input sorting programAfter testing your suggestions in my code I am faced with yet another issue. The input is set to zero for all of my array's elements
Here is the code that was modified: CPP / C++ / C Code:
|
|
#6
|
|||
|
|||
Re: input sorting programQuote:
For example: CPP / C++ / C Code:
Code:
|
|
#7
|
||||
|
||||
Re: input sorting programSince you didn't post the whole program, we can only guess. Are you outputting int_values? If so, look again at the code you posted.
__________________
During the election they said Obama could only be elected when pigs fly. Well, we currently have an epidemic of Swine Flu. Coincidence? |
|
#8
|
|||
|
|||
Re: input sorting programHere is the full code. I just figured i would only need to show the bit that was changed.
CPP / C++ / C Code:
|
|
#9
|
|||
|
|||
Re: input sorting programQuote:
|
|
#10
|
|||
|
|||
Re: input sorting programDoh why didn't I see that ? lol. Thank you
|
Recent GIDBlog
Toyota - 2009 May Promotion by Nihal
| Thread Tools | Search this Thread |
| Rate This Thread | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Equation solver | RazoR | C Programming Language | 3 | 18-May-2008 10:24 |
| Two-Tier data dissemination code installation problem | nidhibansal1984 | Computer Software Forum - Linux | 6 | 16-Sep-2007 11:13 |
| floating point decimal to ascii conversion | crazypal | C Programming Language | 5 | 18-Apr-2007 05:59 |
| Text-Based Roulette Game | mfm1983 | C++ Forum | 5 | 29-Nov-2006 13:20 |
| Sorting program using pointer notation NEED HELP!! | cougar1112 | C++ Forum | 16 | 14-Nov-2005 12:15 |
Network Sites: GIDNetwork · GIDWebHosts · GIDSearch · Learning Journal by J de Silva, The