diff --git a/teoria/a.out b/teoria/a.out deleted file mode 100755 index fe401b0..0000000 Binary files a/teoria/a.out and /dev/null differ diff --git a/teoria/enumeration.cpp b/teoria/enumeration.cpp new file mode 100644 index 0000000..e69de29 diff --git a/teoria/multiple_files/executable.out b/teoria/multiple_files/executable.out deleted file mode 100755 index c60751a..0000000 Binary files a/teoria/multiple_files/executable.out and /dev/null differ diff --git a/teoria/struct.cpp b/teoria/struct.cpp new file mode 100644 index 0000000..f1079f7 --- /dev/null +++ b/teoria/struct.cpp @@ -0,0 +1,73 @@ +#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<