c,c++ÄÚ´æÔËÐÐʱÉîÈëÑо¿
C/C++ÄÚ´æÓëÔËÐÐʱÉîÈëÑо¿ [×÷ÕßJean.Love]
-----------------------------------------------------------------------------------
(Ò»)ÕûÊý·ûºÅµÄÏÝÚå
(¶þ)¸¡µãÊýµÄ±¾ÖÊ
(Èý)¶ÑÕ»µÄÄÚ´æ¹ÜÀí½á¹¹
(ËÄ)·ûºÅ½âÎö
(Îå)¶ÔÆëºÍ×ÜÏß´íÎó
(Áù)º¯ÊýÖ¸Õë
(Æß)Ð麯ÊýµÄʵÏÖ»úÀí
(°Ë)ÒýÓõÄʵÏÖ»úÀí
(¾Å)ÐéÄâ¼Ì³Ð¶ÔÏóµÄÄÚ´æ½á¹¹
(Ê®)»ìºÏ±à³ÌʱµÄ³õʼ»¯Ë³Ðò
(ʮһ)Êý×éºÍÖ¸ÕëµÄÒìͬ
(Ê®¶þ)constÏÞ¶¨µÄ´«µÝÐÔ
(Ê®Èý)Êý¾ÝÀàÐ͵ÄÏÞ¶¨ÐÔ¼ì²é
(Ê®ËÄ)ʹÓÃSTLʱµÄÀàÐÍÏÞÖÆ
(Ê®Îå)µü´úÆ÷×ÔÉíµÄÀàÐÍ
(Ê®Áù)ÔËÐÐʱµÄÀàÐÍÐÅÏ¢
(Ê®Æß)new/deleteÖØÔØ
(Ê®°Ë)ÈçºÎ¿½±´Ò»¸öÎļþ
(Ò»)ÕûÊý·ûºÅµÄÏÝÚå
x
#include
int main(void){
int x=1;
unsigned int y=2;
int b=x
int b2=(x-y<0);
printf("%d,%d\n",b,b2);
return 0;
}
ËüÊä³öʲôÄØ£¿
1,0
ÁîÈËÕ𾪣¬²»ÊÇÂð£¬x
(1)x
(2)x-yµÄ½á¹û¼ÆËãµÄʱºò£¬·µ»ØÒ»¸ö0xfffffffe£¬Ëü±»µ±³ÉÎÞ·ûºÅÊý×ÖÀí½â²¢ºÍ0±È½Ï£¬ÏÔÈ»<0²»³ÉÁ¢£¬·µ»Ø0¡£
×ܽáһϣ¬ÕûÊýµÄÔËË㣬¼Ó¼õ³ËµÄʱºò£¬¸ù±¾²»¹ÜÊÇ·ñÉùÃ÷ΪÊÇ·ñÓзûºÅ£¬ÔÚ2½øÖÆcpuÉÏÃæµÄ¼ÆËãÊÇÏàͬµÄ£¬µ«ÊDZȽϵÄʱºò(<,>,==)»á¸ù¾ÝÀàÐÍ£¬µ÷Óò»Í¬µÄ±È½ÏÖ¸ÁҲ¾ÍÊÇÒÔ²»Í¬µÄ·½Ê½À´Àí½âÕâ¸ö2½øÖƽá¹û¡£µ±signedºÍunsigned»ìÓõÄʱºò£¬È«²¿×Ô¶¯ÌáÉýΪÎÞ·ûºÅÕûÊý¡£
#include
int main(void){
int i=-2;
unsigned j=1;
if(j+i>1) //ÌáÉýΪÁ½¸öuintÏà¼Ó
printf("sum=%d\n",j+i);//´òÓ¡µÄ½á¹û¸ù¾Ý%dÖƶ¨£¬j+iµÄÄÚ´æÖµÓÀÔ¶²»±ä¡£
return 0;
}
Êä³ö
> ./a.out
sum=-1
ÔÙ¾ÙÒ»¸öÀý×Ó
#include
int main(void){
int i=-4;
unsigned int j=1;
int ii=i+j;
unsigned int jj=i+j;
printf("%d,%ud\n",ii,jj);
if(ii>1){printf("100000");}
if(jj>1){printf("100001");}
return 0;
}
ÓÃgcc -SµÃµ½»ã±à£¬»á·¢ÏÖif(ii>1)ºÍif(jj>1)¶ÔÓ¦Á½¸ö²»Í¬µÄÌøתָÁ
Ïà¹ØÎĵµ£º
ϵͳ»·¾³£ºWindows 7
Èí¼þ»·¾³£ºVisual C++ 2008 SP1 +SQL Server 2005
±¾´ÎÄ¿µÄ£º±àдһ¸öº½¿Õ¹ÜÀíϵͳ
ÕâÊÇÊý¾Ý¿â¿Î³ÌÉè¼ÆµÄ³É¹û£¬ËäÈ»³É¼¨²»¼Ñ£¬µ«ÊÇ×÷ΪÎÒÓÃVC++ ÒÔÀ´±àдµÄ×î´ó³ÌÐò»¹ÊÇ´«µ½ÍøÉÏ£¬ÒÔ¹©²Î¿¼¡£ÓÃVC++ ×öÊý¾Ý¿âÉè¼Æ²¢²»ÈÝÒ×£¬µ«Ò²²»ÊDz»¿ÉÄÜ¡£ÒÔÏÂÊÇÎҵijÌÐò½çÃ棬ºóÃæ ......
ÉÏ´Î×ܽáÁËC++£¨ÃæÏò¶ÔÏó£©Éè¼ÆµÄºËÐÄ˼Ï룬²¢ÇÒÀý¾ÙÁËʹÓÃÀàÄ£ÐÍÀ´Ìæ´úifºÍswitchµÄÒ»ÖÖ½ÏΪµäÐ͵ÄÇé¿ö¡£ÏÂÃæÏëÀ´Ì¸Ì¸C++ÔÚ±àÂë·½ÃæµÄÌص㡣
ÔںܶྵäµÄC++½Ì³ÌÖж¼ÓÐÒ»¸ö½¨Ò飺Ӧ¾¡Á¿Ê¹Óû§´úÂ루¿âµÄʹÓÃÕߣ©¿´ÆðÀ´¶ÌС¶ø¼òµ¥¡£°´ÕÕ³£Ê¶£¬¼òµ¥µÄ´úÂëͨ³£Òª±È´ó¶ÎµÄ´úÂëºÃÀí½â£¬¶øÓû§´úÂëͨ³£ÊµÏÖµÄÊÇ×îÉϲãµÄ¹¦ÄÜ»òÕ ......
²Î¿¼¡¶linuxÄÚºËÍêȫעÊÍ¡·ºÍÍøÉÏÏà¹ØÎÄÕÂ
/*
* ¿ØÖÆ̨ÏÔʾ²Ù×÷
*/
/*
* linux/kernel/console.c
*
* (C) 1991 Linus Torvalds
*/
/*
* console.c
*
* This module implements the console io functions
* 'void con_init(v ......
½ñÌìµÚÒ»´ÎÊÔ×ÅÔÚLinuxÏÂдC³ÌÐò£¬°ÑÓöµ½µÄÎÊÌâ¼Ç¼һÏÂ
1. ʹÓÃemacsÃüÁî±à¼³ÌÐòÎļþ£¬ÎÒÖ±½ÓÔÚTerminalÀïÊäÈëÁËemacs£¬Ð´ºÃ³ÌÐò£¬¹Ø±Õ£¬½á¹ûºÍwindowsÀï²»Ò»Ñù£¬²¢Ã»ÓÐÈκÎSaveFileDialogÖ®ÀàµÄ¶Ô»°¿òµ¯³öÀ´£¬×Ô¼ºÐ´µÄ¶«Î÷Ò²²»ÖªµÀ±£´æµ½ÄÄÀïÁË£¬¶øÇÒFile²Ëµ¥ÀïҲûÓÐNewÕâÑùµÄÑ¡Ïî¡£ºóÀ´²ÅÖªµÀ£¬ÔÀ´ÊǵÃÔÚemacsÃüÁîºó ......