Click here to Skip to main content
15,900,907 members
Home / Discussions / C#
   

C#

 
AnswerRe: Unmanaged dll call from C#, AccessViolationExceptionMessage Pin
Richard MacCutchan3-Jul-11 22:37
mveRichard MacCutchan3-Jul-11 22:37 
GeneralRe: Unmanaged dll call from C#, AccessViolationExceptionMessage Pin
marca2923-Jul-11 22:47
marca2923-Jul-11 22:47 
GeneralRe: Unmanaged dll call from C#, AccessViolationExceptionMessage Pin
Richard MacCutchan3-Jul-11 23:22
mveRichard MacCutchan3-Jul-11 23:22 
GeneralRe: Unmanaged dll call from C#, AccessViolationExceptionMessage Pin
marca2923-Jul-11 23:26
marca2923-Jul-11 23:26 
AnswerRe: Unmanaged dll call from C#, AccessViolationExceptionMessage Pin
BobJanova4-Jul-11 0:38
BobJanova4-Jul-11 0:38 
AnswerRe: Unmanaged dll call from C#, AccessViolationExceptionMessage Pin
Pete O'Hanlon4-Jul-11 1:15
mvePete O'Hanlon4-Jul-11 1:15 
AnswerRe: Unmanaged dll call from C#, AccessViolationExceptionMessage Pin
George Tryfonas5-Jul-11 3:33
George Tryfonas5-Jul-11 3:33 
Questiondatabase connection code in c# for asp .net Pin
Arvind Vishwakarma2-Jul-11 6:09
Arvind Vishwakarma2-Jul-11 6:09 
AnswerRe: database connection code in c# for asp .net Pin
Richard MacCutchan2-Jul-11 6:47
mveRichard MacCutchan2-Jul-11 6:47 
AnswerRe: database connection code in c# for asp .net Pin
PIEBALDconsult2-Jul-11 6:54
mvePIEBALDconsult2-Jul-11 6:54 
AnswerRe: database connection code in c# for asp .net Pin
RaviRanjanKr2-Jul-11 8:34
professionalRaviRanjanKr2-Jul-11 8:34 
AnswerRe: database connection code in c# for asp .net Pin
Abhinav S2-Jul-11 23:33
Abhinav S2-Jul-11 23:33 
Questionhow to "inject" string Pin
igalep1322-Jul-11 5:53
igalep1322-Jul-11 5:53 
AnswerRe: how to "inject" string Pin
PIEBALDconsult2-Jul-11 6:06
mvePIEBALDconsult2-Jul-11 6:06 
AnswerRe: how to "inject" string PinPopular
Mark Salsbery2-Jul-11 6:09
Mark Salsbery2-Jul-11 6:09 
AnswerRe: how to "inject" string Pin
Philippe Mori2-Jul-11 12:37
Philippe Mori2-Jul-11 12:37 
AnswerRe: how to "inject" string Pin
#realJSOP3-Jul-11 5:59
professional#realJSOP3-Jul-11 5:59 
Your sample doesn't really make any sense.

Why don't you just do it this way:

C#
for (int i = 0; i < arr.Length; i++)
{
    dic.Add(arr[i], arr.length);
}


One of the Console.WriteLine method overloads acts just like string.Format. You pass a format string, followed by an array of objects. The number inside the curly braces indicates the index into the specified object array. Just like all other arrays, this one is 0 based, and you can't specify a value < 0 or > the number of elements in the array (minus 1). You can specify the same array index over and over again:

WriteLine("{0}{0}{0}", "x", "y");


which would result in "xxx" being written

or even out of order:

WriteLine("{2}{1}{0}", "x", "y", "z");


which would result in "zyx" being written.

You can have more objects to format, but your indexes in the format string can never exceed the number of objects in the array.
".45 ACP - because shooting twice is just silly" - JSOP, 2010
-----
You can never have too much ammo - unless you're swimming, or on fire. - JSOP, 2010
-----
"Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass." - Dale Earnhardt, 1997


AnswerRe: how to "inject" string Pin
Shameel3-Jul-11 8:34
professionalShameel3-Jul-11 8:34 
Questionms access afterupdate event in c# textbox Pin
Asif Rehman1-Jul-11 23:34
Asif Rehman1-Jul-11 23:34 
AnswerRe: ms access afterupdate event in c# textbox Pin
JOAT-MON2-Jul-11 3:12
JOAT-MON2-Jul-11 3:12 
AnswerRe: ms access afterupdate event in c# textbox Pin
JOAT-MON2-Jul-11 3:26
JOAT-MON2-Jul-11 3:26 
QuestionFile Type forensic identification Pin
devvvy1-Jul-11 14:20
devvvy1-Jul-11 14:20 
AnswerRe: File Type forensic identification Pin
Philippe Mori1-Jul-11 14:58
Philippe Mori1-Jul-11 14:58 
AnswerRe: File Type forensic identification Pin
PIEBALDconsult1-Jul-11 18:51
mvePIEBALDconsult1-Jul-11 18:51 
QuestionImplementing a list of abstract objects... Pin
faheemnadeem1-Jul-11 10:15
faheemnadeem1-Jul-11 10:15 

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.