#include using namespace std; void differentStructSize(); void studentStruct(); int main(){ studentStruct(); return 0; } void studentStructWithConstructor(){ struct StudentNoDefaultConstructor{ string nome, cognome, matricola; int annoCorso; StudentNoDefaultConstructor(string n, string c, string m, int a){ nome = m; cognome = c; matricola = m; annoCorso = a; } }; struct StudentNoDefaultConstructor st1{"Alan","Turing","N86000000",1}; //OK //struct StudentNoDefaultConstructor st2; //errore. no default constructor /* Qui lascia compilare la dichiarazione di st3 ma non permette di lavorarci su, causa costruttore di default mancante. */ struct StudentNoDefaultConstructor st3(); //st3.nome = "Planck"; //cout<