Click here to Skip to main content
15,886,199 members
Home / Discussions / C#
   

C#

 
AnswerRe: dll security Pin
Arun Jacob3-Sep-09 18:06
Arun Jacob3-Sep-09 18:06 
GeneralRe: dll security Pin
amit_upadhyay3-Sep-09 22:54
amit_upadhyay3-Sep-09 22:54 
GeneralRe: dll security Pin
Arun Jacob3-Sep-09 22:56
Arun Jacob3-Sep-09 22:56 
GeneralRe: dll security Pin
mustang863-Sep-09 6:21
mustang863-Sep-09 6:21 
GeneralRe: dll security Pin
amit_upadhyay3-Sep-09 6:30
amit_upadhyay3-Sep-09 6:30 
GeneralRe: dll security Pin
mustang863-Sep-09 10:22
mustang863-Sep-09 10:22 
QuestionProblem with sorting string using radix sort [modified] Pin
gamer11272-Sep-09 20:16
gamer11272-Sep-09 20:16 
AnswerRe: Problem with sorting string using radix sort [modified] Pin
Calla3-Sep-09 4:53
Calla3-Sep-09 4:53 
Looking at the part that fails a bit closer..
int W = arrayOfLastNames[a].Length;
Console.WriteLine("{0}", W);

string[] temp = new string[arrayOfLastNames.Length];
for (int d = W - 1; d >= 0; d--)
{
   int[] count = new int[50];
   for (int i = 0; i < N; i++)
   {
      count[arrayOfLastNames[i][d] + 1]++;


W gets the length of the first item in arrayOfLastNames. In your for-loop you declare
for (int d = W - 1; d >= 0; d--)

An array in C# is zero based so the characters in the first name (of the last names) will be indexed from 0 to W - 1 which equals d, right? And you declare this in your for-loop but then you add + 1 again in the count[arrayOfLastNames[i][d] + 1] part causing the exception. You can't add 1 when d is the end of the array Wink | ;)

modified on Thursday, September 3, 2009 11:12 AM

GeneralRe: Problem with sorting string using radix sort Pin
gamer11273-Sep-09 5:15
gamer11273-Sep-09 5:15 
GeneralRe: Problem with sorting string using radix sort Pin
Calla3-Sep-09 20:45
Calla3-Sep-09 20:45 
QuestionSkinning a WinForm Pin
Azghar Hussain2-Sep-09 19:49
professionalAzghar Hussain2-Sep-09 19:49 
QuestionHow to geta an Event? Pin
Jacobb Michael2-Sep-09 19:13
Jacobb Michael2-Sep-09 19:13 
AnswerRe: How to geta an Event? Pin
Calla2-Sep-09 20:25
Calla2-Sep-09 20:25 
GeneralRe: How to geta an Event? Pin
Jacobb Michael2-Sep-09 23:24
Jacobb Michael2-Sep-09 23:24 
QuestionHow to refresh an updated MenuStrip at runtime? Pin
dean93592-Sep-09 19:00
dean93592-Sep-09 19:00 
AnswerRe: How to refresh an updated MenuStrip at runtime? Pin
Muhammad Mazhar2-Sep-09 19:08
Muhammad Mazhar2-Sep-09 19:08 
GeneralRe: How to refresh an updated MenuStrip at runtime? Pin
dean93592-Sep-09 19:55
dean93592-Sep-09 19:55 
AnswerRe: How to refresh an updated MenuStrip at runtime? Pin
Orzer2-Sep-09 21:34
Orzer2-Sep-09 21:34 
GeneralRe: How to refresh an updated MenuStrip at runtime? Pin
dean93593-Sep-09 8:20
dean93593-Sep-09 8:20 
QuestionChanging value of several comboboxes Pin
Denis J. González2-Sep-09 16:42
Denis J. González2-Sep-09 16:42 
AnswerRe: Changing value of several comboboxes Pin
Christian Graus2-Sep-09 17:01
protectorChristian Graus2-Sep-09 17:01 
GeneralRe: Changing value of several comboboxes Pin
Denis J. González2-Sep-09 17:06
Denis J. González2-Sep-09 17:06 
GeneralRe: Changing value of several comboboxes Pin
Christian Graus2-Sep-09 17:13
protectorChristian Graus2-Sep-09 17:13 
GeneralRe: Changing value of several comboboxes Pin
Denis J. González2-Sep-09 17:24
Denis J. González2-Sep-09 17:24 
Questionhelp file Pin
AAKAra2-Sep-09 10:54
AAKAra2-Sep-09 10:54 

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.