Click here to Skip to main content
15,888,610 members
Home / Discussions / C#
   

C#

 
GeneralRe: User Input Into Array, Need To Check Array Member If It Is Greater Then 100 Or Less Then 0 Pin
Sivyo9-Sep-09 22:11
Sivyo9-Sep-09 22:11 
GeneralRe: User Input Into Array, Need To Check Array Member If It Is Greater Then 100 Or Less Then 0 Pin
SeMartens9-Sep-09 22:12
SeMartens9-Sep-09 22:12 
GeneralRe: User Input Into Array, Need To Check Array Member If It Is Greater Then 100 Or Less Then 0 Pin
Sivyo9-Sep-09 22:14
Sivyo9-Sep-09 22:14 
GeneralRe: User Input Into Array, Need To Check Array Member If It Is Greater Then 100 Or Less Then 0 Pin
SeMartens9-Sep-09 22:19
SeMartens9-Sep-09 22:19 
GeneralRe: User Input Into Array, Need To Check Array Member If It Is Greater Then 100 Or Less Then 0 Pin
Sivyo9-Sep-09 22:21
Sivyo9-Sep-09 22:21 
GeneralRe: User Input Into Array, Need To Check Array Member If It Is Greater Then 100 Or Less Then 0 Pin
DavodM9-Sep-09 22:33
DavodM9-Sep-09 22:33 
GeneralRe: User Input Into Array, Need To Check Array Member If It Is Greater Then 100 Or Less Then 0 Pin
Sivyo9-Sep-09 22:39
Sivyo9-Sep-09 22:39 
GeneralRe: User Input Into Array, Need To Check Array Member If It Is Greater Then 100 Or Less Then 0 Pin
DavodM9-Sep-09 22:53
DavodM9-Sep-09 22:53 
I see. It should be a fairly easy fix then. (although you have some other problems in your user input code)

The easiest way to fix the crash is to remove the else block completely. Think about it, if intSet[i] is not between 0 and 100 there is not an entry in the boolSet array to hold the information, and in fact you don't need one if you only care about the numbers 0 to 100 anyway!


The best way with your current code would be to have all the elements in boolSet set to false to start with then let the code you already have set to true the ones the user entered.

For the problems with your input code, try entering 1, 2, d. Cool | :cool:

Also if you have the requirements from the assignment posting them here (or the relevant parts) would give us a clear idea of what you have to achieve. (note I have no intention of doing your homework for you but im quite happy to you help you with problems as you have been doing the work yourself so far! Laugh | :laugh: )
GeneralRe: User Input Into Array, Need To Check Array Member If It Is Greater Then 100 Or Less Then 0 Pin
Sivyo9-Sep-09 23:05
Sivyo9-Sep-09 23:05 
GeneralRe: User Input Into Array, Need To Check Array Member If It Is Greater Then 100 Or Less Then 0 Pin
DavodM9-Sep-09 23:18
DavodM9-Sep-09 23:18 
GeneralRe: User Input Into Array, Need To Check Array Member If It Is Greater Then 100 Or Less Then 0 Pin
Sivyo9-Sep-09 23:23
Sivyo9-Sep-09 23:23 
GeneralRe: User Input Into Array, Need To Check Array Member If It Is Greater Then 100 Or Less Then 0 Pin
Sivyo9-Sep-09 23:12
Sivyo9-Sep-09 23:12 
GeneralRe: User Input Into Array, Need To Check Array Member If It Is Greater Then 100 Or Less Then 0 Pin
DavodM9-Sep-09 23:23
DavodM9-Sep-09 23:23 
GeneralRe: User Input Into Array, Need To Check Array Member If It Is Greater Then 100 Or Less Then 0 Pin
Sivyo9-Sep-09 23:31
Sivyo9-Sep-09 23:31 
GeneralRe: User Input Into Array, Need To Check Array Member If It Is Greater Then 100 Or Less Then 0 Pin
DavodM9-Sep-09 23:35
DavodM9-Sep-09 23:35 
GeneralRe: User Input Into Array, Need To Check Array Member If It Is Greater Then 100 Or Less Then 0 Pin
Sivyo9-Sep-09 23:39
Sivyo9-Sep-09 23:39 
GeneralRe: User Input Into Array, Need To Check Array Member If It Is Greater Then 100 Or Less Then 0 Pin
Sivyo10-Sep-09 12:06
Sivyo10-Sep-09 12:06 
Questioninfo on Evidence class Pin
manustone9-Sep-09 19:59
manustone9-Sep-09 19:59 
AnswerRe: info on Evidence class Pin
SeMartens9-Sep-09 21:28
SeMartens9-Sep-09 21:28 
QuestionHow to access Cache Data Pin
sjs4u9-Sep-09 19:52
sjs4u9-Sep-09 19:52 
AnswerRe: How to access Cache Data Pin
SeMartens9-Sep-09 21:34
SeMartens9-Sep-09 21:34 
GeneralRe: How to access Cache Data Pin
sjs4u9-Sep-09 22:01
sjs4u9-Sep-09 22:01 
Questionwrapper to use C++ library in C# Pin
flyakiteosx9-Sep-09 19:25
flyakiteosx9-Sep-09 19:25 
AnswerRe: wrapper to use C++ library in C# Pin
Sindicoro9-Sep-09 20:35
Sindicoro9-Sep-09 20:35 
GeneralRe: wrapper to use C++ library in C# Pin
flyakiteosx9-Sep-09 22:02
flyakiteosx9-Sep-09 22:02 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.