MSDN 中 Buffer 的 错误示例程序.

ms-help://MS.VSCC.2003/MS.MSDNQTR.2003FEB.2052/cpref/html/frlrfsystembufferclassbytelengthtopic.htm

[C#]
int [] arr = new int [5] {0, 1, 2, 3, 4};
Debug.Assert (Buffer.ByteLength(arr) == 20);
for (int i = 0; i < Buffer.ByteLength(arr); i++)
{
Console.Write(arr[i]);
}
//This will print: 00000001000200030004

这个程序居然能够运行? hoho

Published At
Categories with Web编程
Tagged with
comments powered by Disqus