首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 开发语言 > C++ >

dev cpp 多线程解决方案

2012-02-09 
dev cpp 多线程很奇怪的错误,真是摸不着头脑//startserverthreadunsignedthreadIDHANDLEhServer_beginth

dev cpp 多线程
很奇怪的错误,真是摸不着头脑
        //   start   server   thread
        unsigned   threadID;
        HANDLE   hServer   =   _beginthreadex(
                                                                        NULL,                       //   default   security   attributes
                                                                        0,                             //   defautl   stack   size:   1M
                                                                        ServerThread,       //   thread   function   addr
                                                                        NULL,                       //   thread   function   parameter   addr
                                                                        0,                             //   create   flags
                                                                        &threadID);           //   thread   identifier

编译提示最后一个参数类型不对:   invalid   conversion   from   `long   unsigned   int '   to   `void* '  
可是_beginthreadex最后一个参数就是unsigned   类型啊?

Dev-C++   version   4.9.9.2



[解决办法]
long unsigned threadID;
这样看看

[解决办法]
(void *)&threadID
[解决办法]
&threadID
==》
(void *)&threadID 强制类型转化一下

have a try ~

热点排行