E poi dovresti anche dirci cosa vorresti fare con

vettore[j].cognome=char temp[M];