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

C/C++ÓïÑÔ±à³ÌÐÞÑø2

21¡¢gotoÓï¾äµÄʹÓÃ
—————————
 
NÄêÇ°£¬Èí¼þ¿ª·¢µÄÒ»´ú×Úʦ——µÏ½Ü˹ÌØÀ­(Dijkstra)˵¹ý£º“goto statment is
harmful !!”£¬²¢½¨ÒéÈ¡ÏûgotoÓï¾ä¡£ÒòΪgotoÓï¾ä²»ÀûÓÚ³ÌÐò´úÂëµÄά»¤ÐÔ¡£
 
ÕâÀïÎÒҲǿÁÒ½¨Ò鲻ҪʹÓÃgotoÓï¾ä£¬³ý·ÇÏÂÃæµÄÕâÖÖÇé¿ö£º
 
 
    #define FREE(p) if(p) { \
                        free(p); \
                        p = NULL; \
                    }
 
    main()
    main()
    {
        char *fname=NULL, *lname=NULL, *mname=NULL;
 
        fname = ( char* ) calloc ( 20, sizeof(char) );
        if ( fname == NULL ){
goto ErrHandle;
        }
 
        lname = ( char* ) calloc ( 20, sizeof(char) );
        if ( lname == NULL ){
            goto ErrHandle;
        }
 
        mname = ( char* ) calloc ( 20, sizeof(char) );
        if ( mname == NULL ){
            goto ErrHandle;
        }
 
        ......
 
 
     ErrHandle:
     ErrHandle:
  &nb


Ïà¹ØÎĵµ£º

c/c++ʵÏÖÒ»¸öÃܼ¯ÐÍserver/socket¶à·¸´ÓÃselect


×÷Ò»¸ötcpµÄ·þÎñ³ÌÐò£¬Í¬Ê±¿ÉÄÜÓдóÁ¿µÄ¿Í»§¶ËÁ¬ÉÏÀ´£¬Ï£Íû·Ö±ð¼Çס¸÷¸ösocket
Ë­ÓÐÊý¾Ý¹ýÀ´£¬¾Í¶Á³öÀ´£¬·Åµ½Ò»¸öÇëÇó¶ÓÁУ­£­ÕâЩÊÂÇéÓÃÒ»¸öÏß³ÌÍê³É
 
ÁíÍâÓÐÒ»¸ö½á¹û¶ÓÁУ¬Èç¹û½á¹ûÀï°üº¬ÁËsocketµÄ±àºÅ£¬ÓÃÒ»¸öÏß³ÌרÃÅ£º
È¡³öÀ´°´±àºÅÕÒ»ØÔ­À´·¢ËÍÕßsocket£¬·¢»Ø¸øÔ­À´µÄ¿Í»§¶Ë
 
»¹ÓÐÒ»¸ö¾ÍÊÇ´¦ÀíÏ ......

C51: CALLING ASSEMBLY ROUTINES from C

ÒÔÏÂÈ«ÎÄתÔØ×Ôhttp://www.keil.com/support/docs/50.htm                            Copyright © 2010 Keil™, An ARM® Company.
Information in this ar ......

vc++¶ÁÈ¡xmlÎļþÖеÄÊôÐÔÖµ

¼ÙÉèxmlÎļþÊÇ
  <?xml version="1.0" encoding="gb2312" ?>
- <books auth="wren">
- <book id="B01">
  <name>¹þÀﲨÌØ </name>
  <price>10 </price>
  <memo>ÕâÊÇÒ»±¾ºÜºÃ¿´µÄÊé¡£ </memo>
  </book>
- <boo ......

MJÆÀ Ç廪cÓïÑÔÃÅ(һƪC×÷Òµ¿ÉÒÔµöµ½Å®ÓÑ?)

      Ö»ÊÇÓÐÈËÇ£É浽д³ÌÐòµÄ,ÎÒ¾Í˵˵.Å®Ö÷½ÇÈç¹û²»³öÀ´³ÎÇå¾ÍÒ»±²×Ó±»»ÙÁË.У·çÑϽ÷µÄÇ廪ҲÓÐÕâÖÖÀÄSµÄÐÐΪÓе㲻¿É˼Òâ.ÕÒ³ÌÐòԱд×÷ÒµÖ»ÊǸö·ÖÊֵĽè¿Ú°É.Å®Ö÷½Ç»¹Â÷ÇåÐãµÄ.³öÀ´ÌÖÕ®µÄ"Ô©´óÍ·"ÆäʵҲ²»ÀíÖÇ,»ÙÁËÇ°Å®ÓѵÄÐÒ¸£ºÜºÃÂð?
      µ«Ô¸CÓïÑÔÃÅÖ»ÊǸöÓéÀÖ ......

C/C++ÓïÑÔ±à³ÌÐÞÑø1£¨×ª£©

ʲôÊǺõijÌÐòÔ±£¿ÊDz»ÊǶ®µÃºÜ¶à¼¼Êõϸ½Ú£¿»¹ÊǶ®µ×²ã±à³Ì£¿»¹ÊDZà³ÌËٶȱȽϿ죿
ÎÒ¾õµÃ¶¼²»ÊÇ¡£¶ÔÓÚһЩ¼¼Êõϸ½ÚÀ´ËµºÍµ×²ãµÄ¼¼Êõ£¬Ö»Òª¿´°ïÖú£¬²é×ÊÁϾÍÄÜÕÒµ½£¬¶Ô
ÓÚËٶȿ죬ֻҪ±àµÃ¶àÒ²¾ÍÊìÄÜÉúÇÉÁË¡£
 
ÎÒÈÏΪºÃµÄ³ÌÐòÔ±Ó¦¸ÃÓÐÒÔϼ¸·½ÃæµÄËØÖÊ£º
 
  1¡¢ÓÐרÑо«Éñ£¬ÇÚѧÉÆÎÊ¡¢¾ÙÒ»·´ ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ