I was using .Net Reflector to look at some methods in the String class
and found this one:
Friend Sub AppendInPlace(ByVal value As Char*, ByVal count As Integer,
ByVal currentLength As Integer)
Dim local1 As Char*
Fixed local1 = AddressOf Me.m_firstChar
Dim num1 As Integer
For num1 = 0 To count - 1
local1((currentLength + num1)) = value(num1)
Next num1
End Fixed
Me.SetLength((currentLength + count))
Me.NullTerminate
End Sub
In C# is shows like this:
internal unsafe void AppendInPlace(char* value, int count, int
currentLength)
{
fixed (char* local1 = &this.m_firstChar)
{
for (int num1 = 0; num1 < count; num1++)
{
local1[currentLength + num1] = value[num1];
}
}
this.SetLength(currentLength + count);
this.NullTerminate();
}
fixed is apparently a statement in C# but I was curious about its use
in VB.Net. Specifically the Fixed .. End Fixed construct. This is
obviously invalid as it wont even compile in the IDE. So why is
Reflector showing its output? How would the C# code be translated to
VB.Net?