non hai creato gli oggetti dell'array
Dati ar[] = new Dati[5];
ar[0] = new Dati();
code:ar[0].N = 1;