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

ǶÈëʽC±ÊÊÔ£¡

1. ÓÃÔ¤´¦ÀíÖ¸Áî#define ÉùÃ÷Ò»¸ö³£Êý£¬ÓÃÒÔ±íÃ÷1ÄêÖÐÓжàÉÙÃ루ºöÂÔÈòÄêÎÊÌ⣩
#define SECONDS_PER_YEAR (60 * 60 * 24 * 365)UL
ÎÒÔÚÕâÏë¿´µ½¼¸¼þÊÂÇ飺
1). #define Óï·¨µÄ»ù±¾ÖªÊ¶£¨ÀýÈ磺²»ÄÜÒԷֺŽáÊø£¬À¨ºÅµÄʹÓ㬵ȵȣ©
2). ¶®µÃÔ¤´¦ÀíÆ÷½«ÎªÄã¼ÆËã³£Êý±í´ïʽµÄÖµ£¬Òò´Ë£¬Ö±½Óд³öÄãÊÇÈçºÎ¼ÆËãÒ»ÄêÖÐÓжàÉÙÃë¶ø²»ÊǼÆËã³öʵ¼ÊµÄÖµ£¬ÊǸüÇåÎú¶øûÓдú¼ÛµÄ¡£
3). Òâʶµ½Õâ¸ö±í´ïʽ½«Ê¹Ò»¸ö16λ»úµÄÕûÐÍÊýÒç³ö-Òò´ËÒªÓõ½³¤ÕûÐÍ·ûºÅL,¸æËß±àÒëÆ÷Õâ¸ö³£ÊýÊǵij¤ÕûÐÍÊý¡£
4). Èç¹ûÄãÔÚÄãµÄ±í´ïʽÖÐÓõ½UL£¨±íʾÎÞ·ûºÅ³¤ÕûÐÍ£©£¬ÄÇôÄãÓÐÁËÒ»¸öºÃµÄÆðµã¡£¼Çס£¬µÚÒ»Ó¡ÏóºÜÖØÒª¡£
2. дһ¸ö“±ê×¼”ºêMIN£¬Õâ¸öºêÊäÈëÁ½¸ö²ÎÊý²¢·µ»Ø½ÏСµÄÒ»¸ö¡£
#define MIN(A,B) ((A) <= (B) (A) : ))
Õâ¸ö²âÊÔÊÇΪÏÂÃæµÄÄ¿µÄ¶øÉèµÄ£º
1). ±êʶ#defineÔÚºêÖÐÓ¦ÓõĻù±¾ÖªÊ¶¡£ÕâÊǺÜÖØÒªµÄ£¬ÒòΪֱµ½Ç¶Èë(inline)²Ù×÷·û±äΪ±ê×¼CµÄÒ»²¿·Ö£¬ºêÊÇ·½±ã²úÉúǶÈë´úÂëµÄΨһ·½·¨£¬¶ÔÓÚǶÈëʽϵͳÀ´Ëµ£¬ÎªÁËÄÜ´ïµ½ÒªÇóµÄÐÔÄÜ£¬Ç¶Èë´úÂë¾­³£ÊDZØÐëµÄ·½·¨¡£
2). ÈýÖØÌõ¼þ²Ù×÷·ûµÄ֪ʶ¡£Õâ¸ö²Ù×÷·û´æÔÚCÓïÑÔÖеÄÔ­ÒòÊÇËüʹµÃ±àÒëÆ÷ÄܲúÉú±Èif-then-else¸üÓÅ»¯µÄ´úÂ룬Á˽âÕâ¸öÓ÷¨ÊǺÜÖØÒªµÄ¡£
3). ¶®µÃÔÚºêÖÐСÐĵذѲÎÊýÓÃÀ¨ºÅÀ¨ÆðÀ´
4). ÎÒÒ²ÓÃÕâ¸öÎÊÌ⿪ʼÌÖÂÛºêµÄ¸±×÷Óã¬ÀýÈ磺µ±ÄãдÏÂÃæµÄ´úÂëʱ»á·¢ÉúʲôÊ£¿
least = MIN(*p++, b);
3. Ô¤´¦ÀíÆ÷±êʶ#errorµÄÄ¿µÄÊÇʲô£¿
Èç¹ûÄã²»ÖªµÀ´ð°¸£¬Çë¿´²Î¿¼ÎÄÏ×1¡£ÕâÎÊÌâ¶ÔÇø·ÖÒ»¸öÕý³£µÄ»ï¼ÆºÍÒ»¸öÊé´ô×ÓÊǺÜÓÐÓõġ£Ö»ÓÐÊé´ô×ӲŻá¶ÁCÓïÑԿα¾µÄ¸½Â¼È¥ÕÒ³öÏóÕâÖÖ
ÎÊÌâµÄ´ð°¸¡£µ±È»Èç¹ûÄã²»ÊÇÔÚÕÒÒ»¸öÊé´ô×Ó£¬ÄÇôӦÊÔÕß×îºÃÏ£Íû×Ô¼º²»ÒªÖªµÀ´ð°¸¡£
ËÀÑ­»·£¨Infinite loops£©
4. ǶÈëʽϵͳÖо­³£ÒªÓõ½ÎÞÏÞÑ­»·£¬ÄãÔõôÑùÓÃC±àдËÀÑ­»·ÄØ£¿
Õâ¸öÎÊÌâÓü¸¸ö½â¾ö·½°¸¡£ÎÒÊ×Ñ¡µÄ·½°¸ÊÇ£º
while(1) { }
һЩ³ÌÐòÔ±¸üϲ»¶ÈçÏ·½°¸£º
for(;;) { }
Õâ¸öʵÏÖ·½Ê½ÈÃÎÒΪÄÑ£¬ÒòΪÕâ¸öÓ﷨ûÓÐÈ·Çбí´ïµ½µ×Ôõô»ØÊ¡£Èç¹ûÒ»¸öÓ¦ÊÔÕ߸ø³öÕâ¸ö×÷Ϊ·½°¸£¬ÎÒ½«ÓÃÕâ¸ö×÷Ϊһ¸ö»ú»áȥ̽¾¿ËûÃÇÕâÑù×öµÄ
»ù±¾Ô­Àí¡£Èç¹ûËûÃǵĻù±¾´ð°¸ÊÇ£º“ÎÒ±»½Ì×ÅÕâÑù×ö£¬µ«´ÓûÓÐÏëµ½¹ýΪʲô¡£”Õâ»á¸øÎÒÁôÏÂÒ»¸ö»µÓ¡Ïó¡£
µÚÈý¸ö·½°¸ÊÇÓà goto
Loop:
...
goto Loop;
Ó¦ÊÔÕßÈç¸ø³öÉÏÃæµÄ·½°¸£¬Õâ˵Ã÷»òÕßËûÊÇÒ»¸ö»ã±àÓïÑÔ³ÌÐòÔ±£¨ÕâÒ²ÐíÊǺÃÊ£©»òÕßËûÊÇÒ»¸öÏë½øÈ


Ïà¹ØÎĵµ£º

ArcSDE C APiµÄC#µ÷ÓÃ

Ñ¡Á½¸ö±È½ÏÓдú±íÐԵĺ¯Êý
Ê×ÏÈÏÂÔØ°²×°sdk£¬½«ÆäÖеÄsde.dll,pe.dllºÍsg.dll¿½±´¹ýÀ´
ʹÓÃÈçϵĴúÂ룬ָ¶¨dllºóÖ±½Óµ÷ÓÃÆäÖеĺ¯Êý£¬
/// <summary>
/// Sets the value for a small integer column.
/// </summary>
[DllImport(".\\sde91.dll", SetLastError = true, ......

51µ¥Æ¬»ú Keil C ÑÓʱ³ÌÐòµÄ¼òµ¥Ñо¿

51µ¥Æ¬»ú   Keil   C   ÑÓʱ³ÌÐòµÄ¼òµ¥Ñо¿  
   
  by:   InfiniteSpace   Studio/isjfk,   1.21.2004  
   
  ÈκÎÈ˶¼¿ÉÒÔÔÚ×¢Ã÷Ô­×÷Õߺͳö´¦µÄÇ°ÌáÏÂËæÒâתÔØÕâƪÎÄÕ£¬µ«²»µÃÓÃÓÚÉÌҵĿµÄ¡£  
   
    ......

C preprocessor

Ò»Ö±¾õµÃCÓïÑÔµÄÔ¤´¦Àí
Æ÷ÊǸöÃÀÃî¶øÉñÆæµÄ¹¤¾ß£¬ÒÔºó»á½Ðø°Ñ×Ô¼ºÑ§µ½µÄ¹ØÓÚËüµÄÐÂ֪ʶ×ܽá³öÀ´¡£To be continued aways...
Ò»¡¢ #defineÌæ»»
£¨Pointer ON C
, Ch14.2.2£©
³ÌÐòÖÐÀ©Õ¹#define¶¨Òå·ûºÅºÍºêʱ£¬Éæ¼°Èçϼ¸¸ö²½Ö裺
(1) ÔÚµ÷Óúêʱ£¬Ê×ÏȶԲÎÊý½øÐмì²é£¬¿´¿´ÊÇ·ñ°üº¬ÁËÈκÎÓÉ#define ¶¨ÒåµÄ·ûºÅ£¬Èç¹ ......

dz̸C/C++ÄÚ´æй©¼°Æä¼ì²â¹¤¾ß

¶ÔÓÚÒ»¸öc/c++³ÌÐòÔ±À´Ëµ£¬ÄÚ´æй©ÊÇÒ»¸ö³£¼ûµÄÒ²ÊÇÁîÈËÍ·ÌÛµÄÎÊÌâ¡£ÒѾ­ÓÐÐí¶à¼¼Êõ±»Ñо¿³öÀ´ÒÔÓ¦¶ÔÕâ¸öÎÊÌ⣬±ÈÈçSmart Pointer£¬Garbage CollectionµÈ¡£Smart Pointer¼¼Êõ±È½Ï³ÉÊ죬STLÖÐÒѾ­°üº¬Ö§³ÖSmart PointerµÄclass£¬µ«ÊÇËüµÄʹÓÃËƺõ²¢²»¹ã·º£¬¶øÇÒËüÒ²²»Äܽâ¾öËùÓеÄÎÊÌ⣻Garbage Collection¼¼ÊõÔÚJavaÖÐÒѾ­ ......

ѧÉú¹ÜÀíϵͳ(c/cpp)

#include
using namespace std;
typedef struct lnode
{
    long sno;
    char name[20];
    struct lnode *next;
}LNode, *LinkList;
LinkList InitList()
{
    LinkList head;
    head = new LNode;
 &nb ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ