Çë½Ì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
Èç¹ûÕâÁ½¸ö±í´ïʽÖÁÉÙÓÐÒ»
Ïà¹ØÎÊ´ð£º
ÓÐÒ»10*10¾ØÕ󣬳ýÈ¥µÚÒ»¸öµã£¨0£¬0£©ºÍ×îºóÒ»µã£¨9£¬9£©£¬»¹Óа˸öµãΪ1£¬ÆäËû¶¼Îª0£¬ÒªÇóÓöþάÊý×é±íʾ¡£°Ë¸öµãÊÇËæ»úÉú³ÉµÄ£¬±àдÏà¹Ø³ÌÐò±íʾ¾ØÕóËùÓпÉÄÜÇé¿ö¡£
ÕæÐÄÇó½Ì¸÷λ¸ßÊÖ£¬°¥£¡±¾ÈËÌ«²ËÁË£¡ºÇºÇ£¡
......
СµÜ×î½üÔÚÁË½â¹ØÓÚtiny c µÄÎÊÌâ¡£ÔÚlinuxÏÂ×¼±¸°²×°¡£µ«°²×°Íê³ÉºóÅöµ½ÁËһЩÎÊÌ⡣ϣÍû´ó¼ÒÄܹ»°ïæ½â¾ö¡£ÒÔÏÂÊǰ²×°Íê³ÉºóµÄÖ´Ðв½Öè¡£
[student@localhost ~]$ tcc -v
tcc version 0.9.25
[student@localhos ......
ÏÖÓÐparadoxÊý¾Ý¿âʹÓÃBDEÇý¶¯£¬Äâ¸ÄΪC/S°æ£¬Ôö¼ÓÍøÂç¶ÁÈ¡Êý¾Ý¹¦ÄÜ¡£ÇëÄÄλ´óÏÀ£¬ÌṩԴÂë¡£
˵¾ä²»¿ÍÆøµÄ»°£¬ÓÃparadox×öC/SÊÇ×ÔѰËÀ·¡£
»»Ò»¸öÍøÂçÊý¾Ý¿â
ÒòΪ²»Ï붯´óÊÖÊõ£¬½öÄܹ²Ïí¼¸¸öÎļþ¼´¿É¡£
Da ......
[align=center][/align]CÓïÑÔÖÐÈçºÎÅжÏÒ»¸ödoubleÐ͵ÄÊý×飨Èçdouble S[20]£»£©ÊÇÒ»¸ö¿ÕÊý×飬¼´Êý×éÖÐûÓзÅÈκÎÖµ¡£
û°ì·¨¡£
"ÈκÎÖµ" µÄ¶¨Òå?
¾ÍÊÇÊý×éÊǿյģ¬Ã»ÓÐΪËü¸³Öµ
¿ÉÒÔ¿¼Â ......
ÎÒˮƽºÜ²Ë£¬ÌáÎʵĹÀ¼ÆÒ²ºÜ¸ãЦ£¬ºÇºÇ£¬¸ßÊÖ¼ûÁ¡£
ÎÒÔÚ´úÂëÀïÃæÌí¼ÓÁËÒ»¸ö.cÎļþA£¬ÀïÃæÓÐÒ»¸öº¯Êýf£¬È»ºóÎÒÔÚÁíÍâÒ»¸ö.cÎļþBÖе÷Óô˺¯Êýf£¬µ«ÊÇ£¬BÎļþÖв¢Ã»Óаüº¬¶Ôº¯ÊýfµÄÉùÃ÷£¬Ò²¾ÍÊÇ˵ûÓаüº¬ÎļþAµÄ.h£ ......