??????????????????????壩????????????????????????????????????????в???С??????????壨?????????壩??????public?????????????private????
????????????????????????????public??????????′?????????????г??????
???????
??????        ????????????????????????????????
??????        δ?????????????????????????????????
??????        ?????????????????????????????????public??
??????        ?????????????????????в????д?κι?????
struct S {  //class S Ч?????
int            x;
unsigned short y;
};
S testS1={100??123};
S testS2={200};//δ????????????????????????????os2.y=0;
S TestS[4]={ {100??10}??
{200??20}??
{300} };//δ?????????????????os[2].y??os[3].x??os[3].y??
??????????????????private??protected????????????????????????ù??????????г??????
struct S { //class S?????????飬??????
private:
int x;
public:
double y;
S(void){}
S(int idemo??double ddemo) {x=idemo;y=ddemo;}
void show(void) {cout<<x<<''/t''<<y<<endl;}
};
S os1;//??????????????(??ι?????)
S os2(1000??2.345);
S os3=S(2000??4.567);
S os[4]={S(10??1.234)??S(20??2.234)};//δ???????????????????????????????????????????
??????????:
??????        ??S os3=S(2000??4.567);????У????????????????os3?????????????S(int??double)????????os3???г??????
??????        S os3(2000??4.567); ????? S os3=S(2000??4.567);
??????        ?????os3??????????S os3(100??1.234);os3=S(2000??4.567)?????????????????????os3????????operator=?????????????????????????????????=??????????????????????????????????е????????С?
??????????????????????????????????????????????
??????????????£?
#include <iostream>
using namespace std;
class C {
private:
int x;
public:
C(int idemo) {x=idemo;}
void show(void) {cout<<x<<endl;}
};
struct S {
private:
int x;
public:
S(int idemo) {x=idemo;}
void show(void) {cout<<x<<endl;}
};
int main(int argc?? char *argv[]){
C oc=1000;//??????????????
oc.show();
S os=2000;//??????????????
os.show();
return EXIT_SUCCESS;
}