???????????????C/C++????????
???????????? ???????[ 2012/10/16 13:20:59 ] ????????
???????switch?????????????к????????????????????switch?????????????????????滻???????Ч???????????switch??????????????
enum MsgType{Msg1?? Msg2?? Msg3}
switch (ReceiveMessage()
{
case Msg1;
......
case Msg2;
.....
case Msg3;
.....
}
?????????????????????????δ??????滻????????switch???
/*???????*/
int handleMsg1(void);
int handleMsg2(void);
int handleMsg3(void);
/*??????????????????*/
int (*MsgFunction [])()={handleMsg1?? handleMsg2?? handleMsg3};
/*?????????и???Ч????????滻switch???*/
status=MsgFunction[ReceiveMessage()]();
??????10?????????C++?????????
????C++????????????????OOP????????????C????????г?Ч??????????????????????????????????????????C?????????????Щ???????????е?C++???????????????磬????????????????????к???г??????????????б?????? struct ????????ε??б????ж????????????????????????????С??????????????Ч?????C++??????С??????????塢?????????????????????????????С??Ч???и?????????????C++???Щ?????????????????Щ????????????ó???????
????4???????
?????????????????????????????????????????????????????????????????????????????????Ч????????????????????Щ???????????????????????????????Щ?????????????????????С??????????????????????????C/C++?? ?????????м???????С?????????????????????????????????????????????????????к???????????????????????????Ч????
??????
???·???
??????????????????
2023/3/23 14:23:39???д?ò??????????
2023/3/22 16:17:39????????????????????Щ??
2022/6/14 16:14:27??????????????????????????
2021/10/18 15:37:44???????????????
2021/9/17 15:19:29???·???????·
2021/9/14 15:42:25?????????????
2021/5/28 17:25:47??????APP??????????
2021/5/8 17:01:11