Click here to Skip to main content
15,892,298 members
Home / Discussions / C#
   

C#

 
Questionbaseclass and a interface. Pin
Jarno Burger12-Feb-10 8:42
Jarno Burger12-Feb-10 8:42 
AnswerRe: baseclass and a interface. Pin
Saksida Bojan12-Feb-10 10:16
Saksida Bojan12-Feb-10 10:16 
AnswerRe: baseclass and a interface. Pin
rhuiden12-Feb-10 10:24
rhuiden12-Feb-10 10:24 
GeneralRe: baseclass and a interface. Pin
Jarno Burger14-Feb-10 13:33
Jarno Burger14-Feb-10 13:33 
Questioncodes Pin
ajay 201012-Feb-10 7:27
ajay 201012-Feb-10 7:27 
AnswerRe: codes Pin
Wes Aday12-Feb-10 7:46
professionalWes Aday12-Feb-10 7:46 
GeneralRe: codes Pin
ajay 201012-Feb-10 16:41
ajay 201012-Feb-10 16:41 
GeneralRe: codes Pin
Wes Aday12-Feb-10 17:11
professionalWes Aday12-Feb-10 17:11 
ajay 2010 wrote:
i tried in this way


You would have saved yourself a lot of trouble if you had just said so to begin with.

The first thing is that you have declared ajay as an array of ints with three elements and then later on trying to access the 4th element (ajay[3]). Which will always fail.

The second thing is that ajay doesn't contain anything since you never assigned anything to it. ajay[0] = 0, ajay[1] = 0, etc.

The third thing is that you are going about it too hard. Cast the int to a string and then see if "2" is in the string:
if (x.ToString().Contains("2"))

The last thing is that your question sounds suspiciously like homework and I am not entirely sure that it is not homework. If it is then you have a long hard road ahead of you. You are not likely going to succeed demanding that we provide code to you.
Why is common sense not common?
Never argue with an idiot. They will drag you down to their level where they are an expert.
Sometimes it takes a lot of work to be lazy
Individuality is fine, as long as we do it together - F. Burns

Help humanity, join the CodeProject grid computing team here

GeneralRe: codes Pin
ajay 201012-Feb-10 18:04
ajay 201012-Feb-10 18:04 
GeneralRe: codes Pin
ajay 201012-Feb-10 18:51
ajay 201012-Feb-10 18:51 
AnswerRe: codes Pin
hammerstein0512-Feb-10 8:00
hammerstein0512-Feb-10 8:00 
GeneralRe: codes Pin
ajay 201012-Feb-10 16:43
ajay 201012-Feb-10 16:43 
GeneralRe: codes Pin
hammerstein0512-Feb-10 18:35
hammerstein0512-Feb-10 18:35 
GeneralRe: codes Pin
ajay 201012-Feb-10 18:46
ajay 201012-Feb-10 18:46 
AnswerRe: codes Pin
OriginalGriff12-Feb-10 8:20
mveOriginalGriff12-Feb-10 8:20 
GeneralRe: codes Pin
Dan Mos12-Feb-10 8:26
Dan Mos12-Feb-10 8:26 
GeneralRe: codes Pin
OriginalGriff12-Feb-10 8:44
mveOriginalGriff12-Feb-10 8:44 
GeneralRe: codes Pin
Dan Mos12-Feb-10 8:52
Dan Mos12-Feb-10 8:52 
GeneralRe: codes Pin
ajay 201012-Feb-10 16:45
ajay 201012-Feb-10 16:45 
AnswerRe: codes Pin
Dr.Walt Fair, PE12-Feb-10 8:29
professionalDr.Walt Fair, PE12-Feb-10 8:29 
GeneralRe: codes Pin
OriginalGriff12-Feb-10 8:45
mveOriginalGriff12-Feb-10 8:45 
GeneralRe: codes Pin
DaveyM6912-Feb-10 12:05
professionalDaveyM6912-Feb-10 12:05 
GeneralRe: codes Pin
OriginalGriff12-Feb-10 22:18
mveOriginalGriff12-Feb-10 22:18 
AnswerRe: codes Pin
Pete O'Hanlon12-Feb-10 9:29
mvePete O'Hanlon12-Feb-10 9:29 
AnswerRe: codes Pin
Luc Pattyn12-Feb-10 9:47
sitebuilderLuc Pattyn12-Feb-10 9:47 

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.