Ò׽ؽØÍ¼Èí¼þ¡¢µ¥Îļþ¡¢Ãâ°²×°¡¢´¿ÂÌÉ«¡¢½ö160KB

Pipe is a worm hole connecting C and C++

In C programming language, the observer design pattern is implemented with function pointer (aka callback function). But in Qt library, it introduces signal and slot. How to link a callback function from the C callback function to the C++ siganl and slot is a problem I encounter. Call back function can only be static, but signal and slot can not. There are some triky way to pretend a non-static function to a static function. But the easiest way is to use pipe. the callback function create a pipe and do the read operation, while the siganl function wait for and read at the other end of the pipe.
The pipe is like a worm hole connecting C and C++, two different time and space. How cool!


Ïà¹ØÎĵµ£º

B/S,C/S

BSÓëCSµÄÁªÏµÓëÇø±ð[ת]
5
ÍÆ¼ö
javaÊʺϿª·¢bs½á¹¹£¬cs²»ÊÇËüµÄÇ¿Ïî.
C/SÊÇClient/ServerµÄËõд¡£·þÎñÆ÷ͨ³£²ÉÓøßÐÔÄܵÄPC¡¢¹¤×÷Õ¾»òСÐÍ»ú£¬²¢²ÉÓôóÐÍÊý¾Ý¿âϵͳ£¬ÈçOracle¡¢Sybase¡¢Informix»ò SQL Server¡£¿Í»§¶ËÐèÒª°²×°×¨ÓõĿͻ§¶ËÈí¼þ¡£
B/SÊÇBrower/ServerµÄËõд£¬¿Í»§»úÉÏÖ»Òª°²×°Ò»¸öä¯ÀÀÆ÷£¨Browser£© ......

LinuxÏÂC¿ª·¢Ö®gcc,gdbµÄʹÓÃ

gcc£¬gdbµÄʹÓÃ
×÷Õߣºzccst
 
ÉÏÖÜÎåÔÚͼÊé¹Ý½èÁËÒ»±¾¡¶LinuxÈí¼þ¹¤³Ìʦ£¨CÓïÑÔ£©ÊµÓý̡̳·£¬ÈÃÎÒÊÕ»ñÁ¼¶à¡£²»½ö½öÊÇÊéÖеÄ֪ʶ£¬»¹ÓжÔ֪ʶÌåϵºÍ¼Ü¹¹ÈÏʶµÄÉîÈë¡£
 
LinuxÏÂC¿ª·¢£º
1£¬gcc,gdbµÄʹÓá£
2£¬MakefileÎļþµÄ±àд¡£
3£¬ÏµÍ³º¯ÊýµÄʹÓÃ
4£¬Îļþ²Ù×÷
5£¬´®ÐÐͨÐÅ
6£¬½ø³Ì¿ØÖÆ
7£¬½ø³Ì¼ ......

C/C++ÃæÊÔÌâ

1.½éÉÜÒ»ÏÂSTL£¬Ïêϸ˵Ã÷STLÈçºÎʵÏÖvector.
    Answer£º
    STL £¨±ê׼ģ°æ¿â£¬Standard Template Library.ËüÓÉÈÝÆ÷Ëã·¨µü´úÆ÷×é³É¡£
    STLÓÐÒÔϵÄһЩÓŵ㣺¿ÉÒÔ·½±ãÈÝÒ×µØÊµÏÖËÑË÷Êý¾Ý»ò¶ÔÊý¾ÝÅÅÐòµÈһϵÁеÄËã·¨£»µ÷ÊÔ³ÌÐòʱ¸ü¼Ó°²È« ºÍ·½±ã£»¼´Ê¹ÊÇÈËÃÇÓÃSTLÔÚ ......

³£ÓõÄC±äÁ¿µÄ¶¨Ò巽ʽ

¹ØÓÚº¯ÊýÖ¸ÕëÊý×éµÄ¶¨Òå
¹ØÓÚº¯ÊýÖ¸ÕëÊý×éµÄ¶¨Òå·½·¨£¬ÓÐÁ½ÖÖ£ºÒ»ÖÖÊDZê×¼µÄ·½·¨£»Ò»ÖÖÊÇÃÉÆ­·¨¡£
µÚÒ»ÖÖ£¬±ê×¼·½·¨£º
{
·ÖÎö£ºº¯ÊýÖ¸ÕëÊý×éÊÇÒ»¸öÆäÔªËØÊǺ¯ÊýÖ¸ÕëµÄÊý×é¡£ÄÇôҲ¾ÍÊÇ˵£¬´ËÊý¾Ý½á¹¹ÊÇÊÇÒ»¸öÊý×飬ÇÒÆäÔªËØÊÇÒ»¸öÖ¸Ïòº¯ÊýÈë¿ÚµØÖ·µÄÖ¸Õë¡£
¸ù¾Ý·ÖÎö£ºÊ×ÏÈ˵Ã÷ÊÇÒ»¸öÊý×飺Êý×éÃû[]
Æä´Î£¬ÒªËµÃ ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØÍ¼ | ¸ÓICP±¸09004571ºÅ