Ragazzi ho bisogno del vostro aiuto.
Mi occorre sapere come passare per riferimento un vettore di strutture!
Ho visto che ci sono altre discussioni su questo tema ma nessuna mi è stata d'aiuto.
Avendo:
Come posso passare il vettore di strutture per riferimento a 2 funzioni: vote e freshman?codice:struct info { char nome[N]; int matricola; int voto_laurea; }; int main() { struct info studenti[]; ...
Ho provato cosi:
e rispettivamente:codice:void vote(struct info *studenti); void freshman(struct info *studenti);
Ma da:codice:vote(&studenti); freshman(&studenti);
Sapreste dirmi dove sbaglio?codice:In function 'main': warning: passing argument 1 of 'freshman' from incompatible pointer type [enabled by default] note: expected 'struct info *' but argument is of type 'struct info (*)[50]' warning: passing argument 1 of 'vote' from incompatible pointer type [enabled by default] note: expected 'struct info *' but argument is of type 'struct info (*)[50]'
Grazie in anticipo!![]()

Rispondi quotando