From b1b5f301098f8d9ba4b9bdf91e7d91a4567dab79 Mon Sep 17 00:00:00 2001 From: Alessandro Ferro <49845537+xfarrow@users.noreply.github.com> Date: Thu, 18 Mar 2021 23:13:51 +0100 Subject: [PATCH] lezione 2 + 1/2 --- teoria/a.out | Bin 14488 -> 0 bytes teoria/enumeration.cpp | 0 teoria/multiple_files/executable.out | Bin 13280 -> 0 bytes teoria/struct.cpp | 73 +++++++++++++++++++++++++++ 4 files changed, 73 insertions(+) delete mode 100755 teoria/a.out create mode 100644 teoria/enumeration.cpp delete mode 100755 teoria/multiple_files/executable.out create mode 100644 teoria/struct.cpp diff --git a/teoria/a.out b/teoria/a.out deleted file mode 100755 index fe401b081470ea0f281f265a082721cd0f27f06d..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 14488 zcmeHOeRLevb$_dsY~zpB+SrLdFj~7dN5=75@}~@Sqm{H~1hNs5>==j{uXb0`*88FC z&f2nz!BpU8Ym}f*kj8}uRAQ|D z?wfa4Go#&{B;`*(v%2s8?#H|DW8TcXx!fOY+g9On2`+B&J3?}EOr%i>&eySq5RIZi zT!X(g;(9R+a3y|?O6;WL$~Ds&O3w{Sb`2FK;H1|nJ*FHX(JCb?Mfw()C{rPP5+FN@ z^|W$$`Z^P5x|ae%d9vu-CwU5w>}r=v7StyzOuZ_8rrba38~wVJ+(}!c7a^FEE|vC+ zMuh4o=1F!6HB4AAWxG3IM{)kD#j6xMRD0#drBRIwQ=W&l@mTk!4Qu0(HSt(7JFsS; zVbhvT8~mA+f1T_%`6u05cI=cbksCD>Qa&F%VI==W(+zDskFE~aoH+U7H+xo$c>dk} zA;}iu$MYt{aD_`us~~JKeoOGnJT|@J;OzJ2Ja#$UyWsfjW@&C7F{N#YoHM?m0JFkrXqB1xp zsbs(ID--8f8T}gQ`)rYzOumf1zf6B=9hUNQa~YggYpHqJjCSW@4HO_LEu@7JmXtxZwRl;b)Z}pU)=|uks^sJ!OnYc=c+!hBgUZ?@gqVdd3K)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S)4l`PH1?nwb!f3gF zx39Ck8D-SblyWc~kWoe{N8Qub*4>J@9bZ#NE37WW3N<#$I2S9nMHr!=-}EE;=pIDE z1j7*{5f71Fd#H@kP?0hJd+d*+W+NDn8Uubr5g{0d+Q$Jr4!QKurnCSc*-R_E$I(aw z!By;0Op~uH^eL@v-Ue#8Jv?bq;8nUjB8kX-8RDPP{Y;wQ`4VD$MgfZ%i$2q?^ zM2v!`oZ2$rDG*P{Y4o3?(X8MolBKDQ${fK`$~4c33~_E>CYCL|p~4#<9WwoWpk~aX z1Dp#-5I8q1ypgCG^7@+ED@^|p#T|(xynTrsNC?NDZFxX@gnOz5(SH3GW?ZZ@y4QZ^>{-AYKad7VT3tL)mpBW z2IoGbw*bF}vnbck=OCt=l^&l{oyQFNeMhe_)}K@v zrl-j{NObI_EbH^RdLJ;nl2ZD7u42mf0T7W%nPXNQLXOVbTtA<`n3gL^Za>R0{T|Bc z?9M!&)0iGs`qX}s;r1(797BeD%KChsW2&hJbN#H({eML1Hz|XBKf!cT;iSI?k5m5% zU{r;=R!E%>`JBl29uSeqIsQqYc6~laGL#`RvF-W+1~RGef~Ym)OpNx_Wu`3pR3_>E>rTkJvsG%g+l5->+^Y-=>fYk z@=pDi9r}E3W-22IZ8q3%484I29ieCqQQ~tA{~rR+Gpls5|9_8yVmz$R=cQp4ukWmn zd8U7cF3mmG=kq%MKLb04=O^p&IG%*0=x19kiR&z=s8j#nGD<85 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<