G
Guest
Hi, I have a cumbersome question:
Given the following declaration:
string [,] varray = new string[3,5]; (15 blocks of memory)
Does it allocate a contiguous blocks of memory or not? If it does,
is it guaranteed to be contiguous everytime?
What If I tried to go out of range but in a knowingly safe manner like the
following in order to assign to the next array out of the 3 arrays:
varray[0,5] = "string object"; // out of range overflow
console.writeline(varray[0,1]);
I tried it and I get an exception error, as I should, but, I also tried
catching the exception to allow it to work but the problem is that the
exception blocked my program before the assignment could occur; proving why I
said it did not work. Am I wrong on this last assumption?
In C, something like this particular program would work becuase C is not
very strict when it comes to safety conforms.
I would appreciate if someone could answer these two questions for me, and
also, if I could be refered to a book that gets into the nity-gritty
technicalities of C# semantics. Especially concerning with the subject of
this thread.
Thanks in advance,
Jesika.
Given the following declaration:
string [,] varray = new string[3,5]; (15 blocks of memory)
Does it allocate a contiguous blocks of memory or not? If it does,
is it guaranteed to be contiguous everytime?
What If I tried to go out of range but in a knowingly safe manner like the
following in order to assign to the next array out of the 3 arrays:
varray[0,5] = "string object"; // out of range overflow
console.writeline(varray[0,1]);
I tried it and I get an exception error, as I should, but, I also tried
catching the exception to allow it to work but the problem is that the
exception blocked my program before the assignment could occur; proving why I
said it did not work. Am I wrong on this last assumption?
In C, something like this particular program would work becuase C is not
very strict when it comes to safety conforms.
I would appreciate if someone could answer these two questions for me, and
also, if I could be refered to a book that gets into the nity-gritty
technicalities of C# semantics. Especially concerning with the subject of
this thread.
Thanks in advance,
Jesika.