Friday, September 5, 2008

C# code snippet to demonstrate an array over-run.

using System;

class ArrayErr {
public static void Main() {
int[] sample = new int[10];
int i;

// generate an array overrun
for(i = 0; i < 100; i = i+1)
sample[i] = i;
}
}

0 comments: