Click here to Skip to main content
15,902,112 members
Home / Discussions / C#
   

C#

 
AnswerRe: PLEASE HELP ME CONVERT C++ TO PYTHON Pin
thatraja10-Nov-13 20:00
professionalthatraja10-Nov-13 20:00 
Questionfind total year without intersection in c# Pin
Member 1038120910-Nov-13 4:11
Member 1038120910-Nov-13 4:11 
AnswerRe: find total year without intersection in c# Pin
Dave Kreskowiak10-Nov-13 10:33
mveDave Kreskowiak10-Nov-13 10:33 
Questionc# Pin
Member 1038120910-Nov-13 0:49
Member 1038120910-Nov-13 0:49 
AnswerRe: c# Pin
Abhinav S10-Nov-13 1:39
Abhinav S10-Nov-13 1:39 
GeneralRe: c# Pin
Member 1038120910-Nov-13 1:51
Member 1038120910-Nov-13 1:51 
AnswerRe: c# Pin
Abhinav S10-Nov-13 1:58
Abhinav S10-Nov-13 1:58 
AnswerRe: c# Pin
BillWoodruff10-Nov-13 2:37
professionalBillWoodruff10-Nov-13 2:37 
This is not very "elegant" code, but I think you may be looking for a solution as simple as this:
C#
int[] id1 = { 44, 26, 92, 30, 71, 38 };
int[] id2 = { 44, 59, 83, 47, 26, 4, 30 };

List<int> matches;

private void button1_Click(object sender, EventArgs e)
{
     int[] shortAry;
     int[] longAry;

     matches = new List<int>();

     if (id1.Length < id2.Length)
     {
         shortAry = id1;
         longAry = id2;
     }
     else
     {
         shortAry = id2;
         longAry = id1;
     }

     // you could store either the matching values ... as shown here ...
     // or store the index at which the match occurs ... not shown here ...
     for (int i = 0; i < shortAry.Length; i++)
     {
         if (shortAry[i] == longAry[i]) matches.Add(shortAry[i]);
     }
}
When you exit this Button ClickEventHandler, then, if matches.Count == 0, there are no matches.
"What Turing gave us for the first time (and without Turing you just couldn't do any of this) is he gave us a way of thinking about and taking seriously and thinking in a disciplined way about phenomena that have, as I like to say, trillions of moving parts.

Until the late 20th century, nobody knew how to take seriously a machine with a trillion moving parts. It's just mind-boggling." Daniel C. Dennett

AnswerRe: c# Pin
Richard Deeming11-Nov-13 1:33
mveRichard Deeming11-Nov-13 1:33 
QuestionSave displayed text from Web Page in C# Pin
triXerr9-Nov-13 23:27
triXerr9-Nov-13 23:27 
AnswerRe: Save displayed text from Web Page in C# Pin
Abhinav S10-Nov-13 1:46
Abhinav S10-Nov-13 1:46 
GeneralRe: Save displayed text from Web Page in C# Pin
triXerr10-Nov-13 3:45
triXerr10-Nov-13 3:45 
Questiongenerates codes in 3 tier(3layer ) for application and web using c# Pin
Rahim Lotfi9-Nov-13 3:30
Rahim Lotfi9-Nov-13 3:30 
AnswerRe: generates codes in 3 tier(3layer ) for application and web using c# Pin
Richard MacCutchan9-Nov-13 4:04
mveRichard MacCutchan9-Nov-13 4:04 
AnswerRe: generates codes in 3 tier(3layer ) for application and web using c# Pin
Mycroft Holmes9-Nov-13 14:47
professionalMycroft Holmes9-Nov-13 14:47 
Questionc# Pin
Member 103899378-Nov-13 19:38
Member 103899378-Nov-13 19:38 
AnswerRe: c# Pin
Mycroft Holmes8-Nov-13 20:09
professionalMycroft Holmes8-Nov-13 20:09 
JokeRe: c# Pin
Richard MacCutchan8-Nov-13 23:04
mveRichard MacCutchan8-Nov-13 23:04 
GeneralRe: c# Pin
Mycroft Holmes8-Nov-13 23:19
professionalMycroft Holmes8-Nov-13 23:19 
Questionhow to use cassandra and hadoop in c#.net web application Pin
Mayank Engineer8-Nov-13 19:36
Mayank Engineer8-Nov-13 19:36 
AnswerRe: how to use cassandra and hadoop in c#.net web application Pin
Richard MacCutchan8-Nov-13 23:03
mveRichard MacCutchan8-Nov-13 23:03 
Question"select" statement in C# with a string array Pin
moseslmathew8-Nov-13 18:43
moseslmathew8-Nov-13 18:43 
AnswerRe: "select" statement in C# with a string array Pin
Mycroft Holmes8-Nov-13 20:06
professionalMycroft Holmes8-Nov-13 20:06 
AnswerRe: "select" statement in C# with a string array Pin
OriginalGriff8-Nov-13 23:24
mveOriginalGriff8-Nov-13 23:24 
SuggestionRe: "select" statement in C# with a string array Pin
Richard Deeming11-Nov-13 1:21
mveRichard Deeming11-Nov-13 1:21 

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.