Çë½Ìc¸ßÊÖ£¬defineµÄÎÊÌâ
¸÷λ´óÏÀ£¬Ð¡µÜÓÐÒ»¸öÎÊÌâÇë½Ì£¬ÈçÏÂ
Õâ¸ö #define stack_push ÊÇÒ»¸öº¯Êý£¬µ÷ÓÃÊÇÕâÑùµÄ
int len;
stack_t *stack;
const char *curpos;
int seglen;
const char *next_slash;
int i;
---------
ÒÔÉÏÊDZäÁ¿µÄ¶¨Òå¡£
if (stack_push(curpos, const char *, stack) < 0 || stack_push(next_slash - curpos + 1, int, stack) < 0)
{
stack_destroy(stack);
return -1;
}
ÖÚ´ó¸ç´ó½ãÃÇ£¬ÎÒµÄÎÊÌâ²»ÊÇÕâ¸öµ÷Ó㬶øÊÇÏÂÃæµÄÕâ¸öºê¶¨ÒåÎÒÓиöµØ·½¿´²»Ã÷°×£¬¾ÍÊÇ||ºóÃæµÄ²¿·Ö £¬ÓÈÆäÊÇ*((type *)(stack)->top)++ = (elem), Õⲿ·Ö£¬ÕæµÄÊÇ¿´²»Ã÷°×£¬Çë¸÷λ¸ßÊÖÖ¸½Ìһϰɡ£Ð»Ð»¡£
ʵ¼ÊÉÏÕâ¸öÊǸö±í´ïʽ£¬µ«ÊÇ(elem), Õâ¸öµØ·½£¬¾Í¿´²»Ã÷°×ÁË£¬ÔõôÌæ»»ºÃÏñ¶¼²»¶Ô¡£¸ßÊÖ°ïÎÒ½âÊÍÒ»ÏÂÕâ¶Î´úÂë°É
#define stack_push(elem, type, stack) \
({ \
(stack)->top + sizeof (type) <= (stack)->base + (stack)->size || \
__stack_expand(stack, sizeof (type)) >= 0 ? \
*((type *)(stack)->top)++ = (elem), (stack)->top - (stack)->base : -1; \
})
/* Never call the following function directly. */
int __stack_expand(stack_t *stack, unsigned int esize);
Æäʵ¾ÍÊǸö?:±í´ïʽ
?ÅжϵÄÌõ¼þÊÇ(stack)->top + sizeof (type) <= (stack)->base + (stack)->size »òÕß
__stack_expand(stack, sizeof (type)) >= 0
Èç¹ûÕâÁ½¸ö±í´ïʽÖÁÉÙÓÐÒ»
Ïà¹ØÎÊ´ð£º
ÈçÌ⣬C/C++ÖеÄexeclÔõôµ÷ÓÃдºÃµÄjava³ÌÐò£¬
execl("/opt/java1.5/bin/java","MyClass",NULL);
ÕâÑùµÄ²»ÐÐŶ¡£
²»»á.
ÔËÐÐjava³ÌÐò
ÕÒ¹¤¾ß²é¿´Ò»ÏÂÄǸö³ÌÐòµÄÃüÁîÐÐ
ËÑË÷Ï£ºjni ......
visual c++2008Ëٳɰ棬²»ÄܱàÒëC³ÌÐòÂð£¿Èç¹ûÄÜÊÇÔõô¿ªÊ¼µÄ°¡£¿ÓÃËü´øµÄÃüÁîÌáʾµ¥Ôª³ýÍâ ¡£
н¨¹¤³Ì£¨¿Õ¹¤³Ì»òwin32¿ØÖÆ̨£©
¾ø¶Ô¿ÉÒÔ¡£½¨Á¢win32¿ØÖÆ̨³ÌÐò¾Í¿ÉÒÔ
ÒýÓÃ
н¨¹¤³Ì£¨¿Õ¹¤³Ì»òwin32¿ØÖÆ̨£ ......
ÔھƵê¹ÜÀíϵͳÖÐ,ÓÐÒ»¸ö¶ÔÄÚµÄϵͳ,¹©Ç°Ì¨·þÎñÔ±ºÍ¾ÀíʹÓÃ
»¹ÓÐÒ»¸ö¾ÍÊǶÔÍâ,Èÿͻ§¿ÉÒÔÔÚÍøÉÏÔ¤¶©·¿¼ä,
ËüÃÇÖ®¼äÊÇÔõôͨѶµÄ.?µ±ÎÒÌá½»Ô¤¶©·¿¼äÐÅÏ¢µÄʱºò,
ÔÚ¶ÔÄÚµÄϵͳÖÐ,ÈçºÎÖªµÀÎÒÒѾÌá½»ÁËÐÅÏ¢¹ýÈ¥.Ê¹Ç ......
ÎÒ¸Õ°ÑÌ·ºÆÇ¿µÄµÚÈý°æµÄÊéѧÍ꣬ÎÒÖªµÀµÄÓÐC++£¬CºÍÖ¸Õë CȱÏݺÍÏÝÚå Cר¼Ò±ä³É£¬»¹ÓÐÊý¾Ý½á¹¹£¬ÎÒÏëÎÊÎÊÎÒÓ¦¸ÃÒÔʲô˳ÐòÀ´Ñ§ÄØ
CȱÏݺÍÏÝÚå Cר¼Ò±à³Ì
Êǽø½×µÄ£¬²»Óü±×Å¿´
ÖÁÓÚ
CºÍÖ¸Õë
Äã²»Àí½âÖ ......
Ï£Íû¸ø´ó¼ÒÌṩһЩеÄ˼·.
ÎÒÃÇÔÚʹÓÃC±à³Ìʱ»áÓöµ½Ò»¸öÎÊÌ⣬±ÈÈçÍ·ÎļþµÄÒ»¸öº¯Êý°üº¬ÔÚÒ»¸ölib ÖУ¬µ«ÊÇ
ÔÚʵ¼ÊÁ¬½ÓÖÐÎÒÃDz»ÖªµÀËüÔÚÄĸö¿âÖС£Ò²Ðí¿ÉÐеÄÒ»ÖÖ°ì·¨ÊÇÖ±½ÓÉÏÍø²éѯij¸ö
º¯ÊýµÄÒÀÀµÌõ¼þ£¬Õâ¶Ô ......