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

¶Á¡¶CºÍÖ¸Õë¡·±Ê¼ÇÕªÒª¡¾5¡¿

2010-04-09
µÚÊ®ËÄÕ   Ô¤´¦ÀíÆ÷
1¡¢#define Ìæ»»
ÔÚ³ÌÐòÖÐÀ©Õ¹#define¶¨Òå·ûºÅºÍºêʱ£¬ÐèÒªÉæ¼°¼¸¸ö²½Ö裻
¢Ù¡¢ÔÚµ÷Óúêʱ£¬Ê×ÏȶԲÎÊý½øÐмì²é£¬¿´¿´ÊÇ·ñ°üº¬ÁËÈκÎÓÉ#define¶¨ÒåµÄ·ûºÅ£¬Èç¹ûÊÇ£¬ËüÃÇÊ×Ïȱ»Ìæ»»£»
¢Ú¡¢Ìæ»»ÎļþËæºó±»²åÈëµ½³ÌÐòÖÐÔ­À´ÎļþµÄλÖ㬶ÔÓں꣬²ÎÊýÃû±»ËûÃǵÄÖµÌæ´ú£»
¢Û¡¢×îºó£¬ÔٴζԽá¹ûÎı¾½øÐÐɨÃ裬¿´¿´ËüÊÇ·ñ°üº¬ÁËÓÉ#define¶¨ÒåµÄ·ûºÅ£¬Èç¹ûÊÇ£¬¾ÍÖظ´ÉÏÊö´¦Àí¹ý³Ì£»
2¡¢ºê²ÎÊýºÍ#define¶¨Òå¿ÉÒÔ°üº¬ÆäËû#define¶¨ÒåµÄ·ûºÅ£¬µ«ÊǺ겻¿ÉÒÔ³öÏֵݹ飻
3¡¢#define PRINT( FORMAT, VALUE )  \
printf( "the value of "#VALUE" is "FORMAT" \n", VALUE )
4¡¢ºêÓëÀàÐÍÎÞ¹Ø
5¡¢ÏÂÃæµÄÖ´Ðнá¹û£º
#define MAX( a, b )     ( (a) > (b) ? (a) : (b) )
z = MAX( x++, y++ );  (ÆäÖÐx = 5£»y = 8)
½á¹û£ºx = 6£»y = 10£»z = 9£»
Ô­Òò£ºz = ( (x++) > (y++) ? (x++) : (y++));
6¡¢#undef  (Ô¤´¦ÀíÖ¸ÁÓÃÓÚÒƳýÒ»¸öºê¶¨Òå)
7¡¢Ìõ¼þ±àÒ룺ÔÚ±àÒëÒ»¸ö³ÌÐòʱ£¬Èç¹ûÎÒÃÇ¿ÉÒÔÑ¡ÔñijÌõÓï¾ä»òij×éÓï¾ä£¬½øÐз­Òë»òÕß±»ºöÂÔ£¬³£³£ÏԵúܷ½±ã¡£Ö»ÓÃÓÚµ÷ÊÔ³ÌÐòµÄÓï¾ä¾ÍÊÇÒ»¸öÃ÷ÏÔµÄÀý×Ó£¬ËûÃDz»Ó¦¸Ã³öÏÖÔÚ³ÌÐòµÄ²úÆ·°æ±¾ÖУ¬µ«ÊÇÄã¿ÉÄܲ¢²»Ïñ°ÑÕâЩÓï¾ä´ÓÔ´´úÂëÖÐÎïÀíɾ³ý£¬ÒòΪÐèҪһЩά»¤ÐÔÐÞ¸Äʱ£¬Äã¿ÉÄÜÐèÒªÖØе÷ÊÔÕâ¸ö³ÌÐò£¬»¹ÐèÒªÕâЩÓï¾ä£»
8¡¢Ìõ¼þ±àÒ룺#if ³£Á¿±í´ïʽ ——Õâ¸öÓÉÔ¤´¦ÀíÆ÷½øÐÐÇóÖµ
statement
#endif
9¡¢Ëùν³£Á¿±í´ïʽ£¬¾ÍÊÇ˵Ëü»òÕßÊÇ×ÖÃæÖµ³£Á¿»òÕßÊÇÒ»¸ö#define¶¨ÒåµÄ·ûºÅ£¬Èç¹û±äÁ¿ÔÚÖ´ÐÐÆÚÇ°ÎÞ·¨»ñµÃËûÃǵÄÖµ£¬ÄÇôËûÃÇÈç¹û³öÏÖÔÚ³£Á¿±í´ïʽÖоÍÊÇ·Ç·¨µÄ£¬ÒòΪËûÃǵÄÖµÔÚ±àÒëʱÊDz»¿ÉÔ¤²âµÄ£»
10¡¢Ìõ¼þ±àÒ룺
#if ³£Á¿±í´ïʽ
statement
#elif ³£Á¿±í´ïʽ
statement
#else
other statement
#endif
11¡¢ÅжÏÊÇ·ñ±»¶¨Ò壺
¢Ù¡¢#if   defined(´ýÅжÏÃû)
¢Ú¡¢#ifdef    ´ýÅжÏÃû
¢Û¡¢#if   !defined(´ýÅжÏÃû)
¢Ü¡¢#ifndef  ´ýÅжÏÃû
        ÆäÖÐ#ifµÄ¹¦ÄܸüÇ¿£¡£¡
12¡¢Í·ÎļþǶÌ×£¬±ê×¼ÒªÇó±àÒëÆ÷±ØÐëÖÁÉÙÖ§³Ö8²ãµÄÍ·ÎļþǶÌ×£¬Ò»°ãÀ´Ëµ£¬Ò»µ½Á½²ãÒ²²î²»¶à£»
13¡¢¶àÖØ°üº¬ÔÚ¾ø´ó¶àÊýÇé¿öϳöÏÖÓÚ´óÐͳÌÐòÖУ¬ËüÍùÍùÐèҪʹÓúܶàÍ·Îļþ£¬Òò´ËÒª·¢ÏÖÕâÖÖÇé¿ö²¢²»ÈÝÒ×£¬Òª½â¾öÕâÖÖÎÊÌ⣬ÎÒ


Ïà¹ØÎĵµ£º

keil C ´ÓÁãѧÆð ½Ìѵ1

#include<reg52.h>
#define uchar unsigned char
#define uint unsigned int
uchar num;
void main()
{
 TMOD=0x01;
 TH0=(65536-45872)/256;
 TL0=(65536-45872)%256;
 EA=1;
 ET0=1;
 TR0=1;
 P1=0xFF;
 while(1);
}
void T0_time() interrupt 1
{
  ......

cµÄIO

²¿·ÖÄÚÈÝÀ´×Ôhttp://www.programfan.com/article/2674.htmlÒÔ¼°http://www.programfan.com/article/showarticle.asp?id=2675
²¿·Ö·­ÒëÀ´×ÔTUM skript£¨c programmieren);
1.printf()£º
ǧÍò²»ÒªÒÅÍüÔÚprintf()µÄ×îºóÌí¼ÓNewLine"\n"¡£ÒòΪÔÚcµÄ¿âÖÐͨ³£ÓÐÐлº´æ»úÖÆ£¬Õâ¸öÒâζ×ÅÖ»Óе±Ò»ÐеÄÊäÈëͨ¹ý"\n"½áÊø֮ǰ£¬ÐеÄÊ ......

GCC ±àÒëc³ÌÐòµÄ·½·¨¼°¹ý³Ì½âÎö

GCC ±àÒëc³ÌÐòµÄ·½·¨¼°¹ý³Ì½âÎö 
Justin.zp.Yang 2010.04.10
        Ä¿Ç° Linux ÏÂ×î³£ÓÃµÄ C ÓïÑÔ±àÒëÆ÷ÊÇ GCC £¨ GNU Compiler Collection £©£¬ËüÊÇ GNU ÏîÄ¿ÖзûºÏ ANSI C ±ê×¼µÄ±àÒëϵͳ£¬Äܹ»±àÒëÓà C ¡¢ C++ ºÍ Object C µÈÓïÑÔ±àдµÄ³ÌÐò¡£ GCC ²»½ö¹¦Äܷdz£Ç¿´ó£¬½á¹¹ ......

¹«ÀúתũÀúC³ÌÐò

×¢ÒâÖ»Äܵ½2049Ä꣡
 
#define uchar unsigned char
#define uint unsigned int
#include <intrins.h>
/*
¹«ÀúÄê¶ÔÓ¦µÄÅ©ÀúÊý¾Ý,ÿÄêÈý×Ö½Ú,
¸ñʽµÚÒ»×Ö½ÚBIT7-4 λ±íʾÈòÔÂÔ·Ý,ֵΪ0 ΪÎÞÈòÔÂ,BIT3-0 ¶ÔӦũÀúµÚ1-4 ÔµĴóС
µÚ¶þ×Ö½ÚBIT7-0 ¶ÔӦũÀúµÚ5-12 Ô´óС,µÚÈý×Ö½ÚBIT7 ±íʾũÀúµÚ13 ¸öÔ´óÐ ......

C/C++³ÌÐòÔ±±Ø¶ÁµÄÊ®±¾Êé

ÔÚGmail TopLanguage  Group Öп´µ½Ò»ÆªÎÄÕ“C/C++³ÌÐòÔ±±Ø¶ÁµÄÊ®±¾Ê飨ÉÏ£©”£¬´ó¼ÒµÄÌÖÂÛ¶¼ºÜ¼¤Àø£¬´ó¼Ò¶¼¾õµÃÕâƪÎÄÕÂдµÃºÜ°ô£¬ÎÒÏëÔÚGroupÀïµÄÅóÓѶ¼ÄÜÔÚLookgirlµÄÕâƪÎÄÕÂÀï»ñÒæ²»ÉÙ£¬Îª´Ë¶·µ¨ÔÚ´ËתÔظÃÎÄ£¬¹©¸ü¶àÅóÓѽ»Á÷¡¢Ñ§Ï°¡£
C/C++³ÌÐòÔ±±Ø¶ÁµÄÊ®±¾Ê飨ÉÏ£©
Õâ¸öÌâÄ¿´óµÄÓÐЩÀëÆ×£¬Êµ»°Ëµ£ ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ