Click here to Skip to main content
15,896,063 members
Home / Discussions / C#
   

C#

 
AnswerRe: How can i protect c# .net Code to be decompile? Pin
George Jonsson16-May-16 20:16
professionalGeorge Jonsson16-May-16 20:16 
QuestionCan not send message after login Pin
aheda13-May-16 3:35
aheda13-May-16 3:35 
AnswerRe: Can not send message after login Pin
Gerry Schmitz13-May-16 4:01
mveGerry Schmitz13-May-16 4:01 
AnswerRe: Can not send message after login Pin
Eddy Vluggen13-May-16 4:35
professionalEddy Vluggen13-May-16 4:35 
QuestionHow can i move Mouse accuracy use GDI+? Pin
Member 1243103912-May-16 21:37
Member 1243103912-May-16 21:37 
AnswerRe: How can i move Mouse accuracy use GDI+? Pin
OriginalGriff12-May-16 22:24
mveOriginalGriff12-May-16 22:24 
GeneralRe: How can i move Mouse accuracy use GDI+? Pin
Member 1243103912-May-16 23:09
Member 1243103912-May-16 23:09 
GeneralRe: How can i move Mouse accuracy use GDI+? Pin
OriginalGriff13-May-16 1:30
mveOriginalGriff13-May-16 1:30 
GeneralRe: How can i move Mouse accuracy use GDI+? Pin
Member 1243103913-May-16 5:40
Member 1243103913-May-16 5:40 
GeneralRe: How can i move Mouse accuracy use GDI+? Pin
OriginalGriff13-May-16 6:00
mveOriginalGriff13-May-16 6:00 
QuestionRemote Access UDP hole punching Pin
sigridslima12-May-16 8:52
sigridslima12-May-16 8:52 
AnswerRe: Remote Access UDP hole punching Pin
Dave Kreskowiak13-May-16 0:53
mveDave Kreskowiak13-May-16 0:53 
GeneralRe: Remote Access UDP hole punching Pin
sigridslima15-May-16 4:03
sigridslima15-May-16 4:03 
GeneralRe: Remote Access UDP hole punching Pin
Dave Kreskowiak15-May-16 5:12
mveDave Kreskowiak15-May-16 5:12 
GeneralRe: Remote Access UDP hole punching Pin
sigridslima15-May-16 6:22
sigridslima15-May-16 6:22 
GeneralRe: Remote Access UDP hole punching Pin
Dave Kreskowiak15-May-16 10:15
mveDave Kreskowiak15-May-16 10:15 
GeneralRe: Remote Access UDP hole punching Pin
sigridslima15-May-16 10:25
sigridslima15-May-16 10:25 
GeneralRe: Remote Access UDP hole punching Pin
Dave Kreskowiak15-May-16 17:20
mveDave Kreskowiak15-May-16 17:20 
GeneralRe: Remote Access UDP hole punching Pin
sigridslima16-May-16 0:56
sigridslima16-May-16 0:56 
GeneralRe: Remote Access UDP hole punching Pin
Dave Kreskowiak16-May-16 1:24
mveDave Kreskowiak16-May-16 1:24 
QuestionI can not Parse JSON to string Pin
aheda12-May-16 5:01
aheda12-May-16 5:01 
AnswerRe: I can not Parse JSON to string Pin
Richard Deeming12-May-16 5:31
mveRichard Deeming12-May-16 5:31 
QuestionCannot convert source type object[,] to target type object[][] Pin
gpc4412-May-16 4:21
gpc4412-May-16 4:21 
GeneralRe: Cannot convert source type object[,] to target type object[][] Pin
CHill6012-May-16 4:22
mveCHill6012-May-16 4:22 
AnswerRe: Cannot convert source type object[,] to target type object[][] Pin
OriginalGriff12-May-16 4:54
mveOriginalGriff12-May-16 4:54 
You can't convert a 2D array directly to a jagged array: they are very different.
A 2D array (say 3 columns of 5 rows of integers) is a block of memory 15 integers long, that is accessed via a row and column address:
C#
myArray[2, 4] => integer at [myArray + (4 * 3 * sizeof(int32)) + 2]

A jagged array is something else: it's a 1D array of references to 1D arrays. So if ther are the same size:
C#
myJaggedArray[2][4] => Get the array at [myJaggedArray + (2 * sizeof(Reference))], then use it in [subArray + (4 * sizeof(int32))] to fetch the value.

You can't "magically" convert between them, because there are memory allocations that need to be done, and bounds checking that changes between them: a jagged array doesn't have to have all it's rows with the same number of columns.

If you want to convert you will have to write the code to allocate the new 1D array, allocate each of the row arrays yourself, and manually fill the appropriate cells.
Bad command or file name. Bad, bad command! Sit! Stay! Staaaay...

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.