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

Çë½Ì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++ÓïÑÔÏà¹ØÎÊÌâ - C/C++ / CÓïÑÔ

ÓÐÒ»10*10¾ØÕ󣬳ýÈ¥µÚÒ»¸öµã£¨0£¬0£©ºÍ×îºóÒ»µã£¨9£¬9£©£¬»¹Óа˸öµãΪ1£¬ÆäËû¶¼Îª0£¬ÒªÇóÓöþάÊý×é±íʾ¡£°Ë¸öµãÊÇËæ»úÉú³ÉµÄ£¬±àдÏà¹Ø³ÌÐò±íʾ¾ØÕóËùÓпÉÄÜÇé¿ö¡£
ÕæÐÄÇó½Ì¸÷λ¸ßÊÖ£¬°¥£¡±¾ÈËÌ«²ËÁË£¡ºÇºÇ£¡
......

¹ØÓÚ tiny c ¶Î´íÎóµÄÎÊÌâ - C/C++ / CÓïÑÔ

СµÜ×î½üÔÚÁË½â¹ØÓÚtiny c µÄÎÊÌâ¡£ÔÚlinuxÏÂ×¼±¸°²×°¡£µ«°²×°Íê³ÉºóÅöµ½ÁËһЩÎÊÌ⡣ϣÍû´ó¼ÒÄܹ»°ïæ½â¾ö¡£ÒÔÏÂÊǰ²×°Íê³ÉºóµÄÖ´Ðв½Öè¡£
[student@localhost ~]$ tcc -v
tcc version 0.9.25
[student@localhos ......

¿ÄÇóC/SÔ´Âë - Delphi / Êý¾Ý¿âÏà¹Ø

ÏÖÓÐparadoxÊý¾Ý¿âʹÓÃBDEÇý¶¯£¬Äâ¸ÄΪC/S°æ£¬Ôö¼ÓÍøÂç¶ÁÈ¡Êý¾Ý¹¦ÄÜ¡£ÇëÄÄλ´óÏÀ£¬ÌṩԴÂë¡£
˵¾ä²»¿ÍÆøµÄ»°£¬ÓÃparadox×öC/SÊÇ×ÔѰËÀ·¡£
»»Ò»¸öÍøÂçÊý¾Ý¿â

ÒòΪ²»Ï붯´óÊÖÊõ£¬½öÄܹ²Ïí¼¸¸öÎļþ¼´¿É¡£

Da ......

CÖÐÈçºÎÅжÏdoubleÐÍÊý×éΪ¿Õ - C/C++ / CÓïÑÔ

[align=center][/align]CÓïÑÔÖÐÈçºÎÅжÏÒ»¸ödoubleÐ͵ÄÊý×飨Èçdouble S[20]£»£©ÊÇÒ»¸ö¿ÕÊý×飬¼´Êý×éÖÐûÓзÅÈκÎÖµ¡£
û°ì·¨¡£

"ÈκÎÖµ" µÄ¶¨Òå?

¾ÍÊÇÊý×éÊǿյģ¬Ã»ÓÐΪËü¸³Öµ

¿ÉÒÔ¿¼Â ......

Ò»¸öcСÎÊÌ⣨²ËÄñÌáÎÊ£© - C/C++ / CÓïÑÔ

ÎÒˮƽºÜ²Ë£¬ÌáÎʵĹÀ¼ÆÒ²ºÜ¸ãЦ£¬ºÇºÇ£¬¸ßÊÖ¼ûÁ¡£
ÎÒÔÚ´úÂëÀïÃæÌí¼ÓÁËÒ»¸ö.cÎļþA£¬ÀïÃæÓÐÒ»¸öº¯Êýf£¬È»ºóÎÒÔÚÁíÍâÒ»¸ö.cÎļþBÖе÷Óô˺¯Êýf£¬µ«ÊÇ£¬BÎļþÖв¢Ã»Óаüº¬¶Ôº¯ÊýfµÄÉùÃ÷£¬Ò²¾ÍÊÇ˵ûÓаüº¬ÎļþAµÄ.h£ ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØÍ¼ | ¸ÓICP±¸09004571ºÅ