C++????????????????????
???????????? ???????[ 2014/8/18 11:12:22 ] ???????????????
????C++???й??к????г????????????????????C++??Java?????????顣????????????????????????????????????????澭?????????????Щ???????????????Щ???????????????
???????????????
????[1] ?麯?????????? ??i = 0; ++i++?????????????????????????????????????????????????????????????????????????C++??????????????????á???????????麯???????麯???????????????????????????????????????????????????????麯?????????????麯??????????????????????????Java????????????????
?????????????
????[1] (5??) C++???????main???????????main??????????Щ????
????[2] (5??) ??????C++?????????????singleton????????????????????singleton?????????????????socket????????connection??????????? ????????????????
????[3] (5??) ?????????????????????mutex?????????????mutex???з????????????????????????????unlock???????????????????
class MutexHelper
{
public:
MutexHelper(TLock& lock):iLock(lock) { pthread_mutex_lock(&iLock); }
~MutexHelper() { ptrhead_mutex_unlock(&iLock); }
}
//TODO: disable assignment and cctor
privae:
pthread_mutex_t& iLock;
};
class Worker
{
public:
Worker() { pthread_mutex_init(&iLock?? NULL); }
~Worker() { pthread_mutex_destroy(&iLock); }
public:
void FuncNeedSync();
private:
pthread_mutex_t iLock;
};
void Worker::FuncNeedSync()
{
MutexHelper helper(iLock);
//TODO: something;
}
????[4] (5??) ??????itoa?????????????????????????????????????????????????????????????????????????????????????????????????????????????
????[5] (4??) C++???static????????????????????????static??????????????????
????[6] (4??) ????????std::string rst?????????????????????????????????????????4k???????????????????????reserve??????????????+=??
????[7] (3??) ?????????Щ?????std::map??find??????????????????????????????????std::map????????????????????N???????find????????????κ???????????????????????????????????????????????????????е???????? ??????????????????????????google????
??????
???·???
??????????????????
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