CÃæÊÔÌâ»ã×Ü
1¡¢ int a=2,b=11,c=a+b++/a++; ÔòcֵΪ¶àÉÙ£¿
¡¾¿¼µã¡¿±àÂë¹æ·¶¡£
±íÃæÉÏ¿¼²ìÄã¶ÔÔËËã·ûÓÅÏȼ¶µÄÕÆÎճ̶ȣ¬µ«Êµ¼ÊÉÏÓÅÏȼ¶ÕâЩÍæÒâºÜÄÑËÀ¼ÇÓ²±³µÃס£¿´ó¼ÒµÄÒɻ󲻾ÍÊÇÔËËã·ûµÄ½áºÏ˳Ðòô£¿ÄÇôÈçºÎÈ¥±ÜÃâÄØ£¿c=a+((b++)/(a++))²»¾ÍÐÐÁËô£¬ÆäʵÎÊÌâ±³ºó¿¼²ìµÄÊÇÄãµÄ±àÂë¹æ·¶£¬ÈçºÎдÇåÎúÒ׶®µÄ´úÂ룬ÈçºÎÔÚÒ»¸öÍŶÓÖÐÈÃ×Ô¼ºµÄ´úÂëºÝÈÝÒ׺ÁÎÞÆ«²îµÄÈÃÐÂÈË¿´¶®¡«
2¡¢ StaticÓÃÔÚÈ«¾Ö±äÁ¿¶¨ÒåºÍº¯ÊýÄÚ²¿¾Ö²¿±äÁ¿¶¨ÒåÓкÎÇø±ð£¿
¡¾¿¼µã¡¿±àÂë¹æ·¶¼°Ä£¿é»¯Éè¼Æ¡£
Static±äÁ¿µÄÁ½¸öÊôÐÔÉæ¼°´æ´¢Î»Öü°¿É¼ûÓò¡£ÔÚ´óÐ͵ijÌÐòÉè¼ÆÖÐstaticÈ«¾Ö±äÁ¿¿ÉÒÔÓÐЧµÄ±ÜÃâÃû×Ö¿Õ¼äµÄÖظ´¼°ÎÞÒâµÄ±äÁ¿ÒýÓã¬ÕâÑù¿ÉÒÔÓÐЧµÄÌá¸ß³ÌÐòÉè¼ÆµÄ°²È«ÐÔ£¬Í¬Ê±Ò²ÀûÓÃÄ£¿é»¯×÷Òµ
3¡¢ ÔÚ³ÌÐòÉè¼ÆÖÐÄÄЩµØ·½ÐèҪʹÓÃdefine£¿ÈçºÎÓÃdefineÀ´¶¨ÒåÒ»ÄêÄÚÓжàÉÙСʱµÄ³£Á¿£¿
¡¾¿¼µã¡¿¿ÉÒÆÖ²ÐÔ¡£
ǶÈëʽ³ÌÐòÉè¼ÆµÄÌصã¾ÍÊÇÈíÓ²¼þƽ̨¿É±äÐÔ£¬ÓÐЧÀûÓÃdefine³£Á¿¿ÉÒÔÌá¸ß³ÌÐòµÄ¿ÉÒÆÖ²ÐÔ£¬ÕâÑù¸Ä¶¯·½±ã£¬²»Ò׳ö´í
4¡¢ DefineºêÓï¾äºÍinlineº¯ÊýÓÐʲôÇø±ð£¿
¡¾¿¼µã¡¿Ê±¿ÕЧÂʼ°ºêµÄ¸±×÷Óá£
ǶÈëʽϵͳƽ̨ͨ³£´æ´¢×ÊÔ´ÓÐÏÞ£¬µ«Í¬Ê±ÓÖ¶ÔʵʱÐÔÓÐÒ»¶¨µÄÒªÇ󣬶þÕßÈçºÎȨºâÐèÒª¿¼ÂÇ¡£DefineºêÓï¾äÏà¶ÔÓÚº¯Êýµ÷ÓÃÄÜÌá¸ßÔËÐÐʱ¼äÐÔÄÜ£¬µ«ÏûºÄÁ˿ռ䣬²¢ÇÒ²»±ê×¼µÄºêÓï¾ä¶¨ÒåÔÚ²»±ê×¼µÄ±àÂëÖиüÈÝÒ׳öÏÖ¸±×÷Óã¬Òò´Ëinlineº¯ÊýÔòÊÇdefineÓï¾äµÄÍêÃÀÌæ´úÆ·¡£Ð¡×ʽð¸É´óÊÂÕýÊÇǶÈëʽµÄÖÕ¼«Ä¿±ê£¡
5¡¢ ÄÄЩµØ·½¿ÉÒÔÓõ½const£¿const±äÁ¿ºÍº¯ÊýÊäÈë²ÎÊýÓÃconstÐÞÊÎÓÐÄÄЩ×÷Óã¿
¡¾¿¼µã¡¿³ÌÐòÉè¼Æ¿É¿¿ÐÔ¡£
ConstÖ»¶Á±äÁ¿¿ÉÒÔÓÐЧ¿Ë·þdefine³£Á¿µÄһЩ±×¶Ë£¬ÈçÎÞÀàÐÍ°²È«¼ì²é¡£ConstÐβοÉÒÔÓÐЧ±ÜÃâ³ÌÐòÄÚ²¿¸ü¸ÄÎÞÒâµÄ¸ü¸Ä¡£ÈË·ÇÊ¥ÏÍÊëÄÜÎÞÎó£¬ËùÒÔÎÒÃÇÒª½«ÕâЩ¿ÉÄܵÄʧÎóͳͳ½»¸øÖÇÄܵıàÒëÆ÷£¬ÕâÑù¾Í¿ÉÒÔ½«´íÎó¶óɱÔÚÒ¡ÀºÖÐ
6¡¢ Int£¬short£¬charÔÚ32λƽ̨ϸ÷Õ¼¼¸¸ö×Ö½Ú£¿Ò»¸ö½á¹¹Ì庬ÓÐint¡¢short¡¢char±äÁ¿¸÷Ò»¸ö£¬½á¹¹ÌåÕ¼¾ÝµÄ×ÜÄÚ´æ¿Õ¼ä¶àÉÙ£¿
¡¾¿¼µã¡¿¿çƽ̨ÒÆÖ²¡£
ǶÈëʽ²¢·Çx86£¬ÆäÓ²¼þƽ̨¾ß±¸ºÜ´óµÄ²îÒìÐÔ£¬Í¬ÎªintÔÚ²»Í¬µÄ¼Ü¹¹ÌåϵÏ¿ÉÄÜÕ¼¾ÝµÄ×Ö½ÚÊýÊDz»Ò»ÑùµÄ¡£²»Í¬µÄƽ̨ҲÓв»Í¬µÄ±àÒëÆ÷£¬ÆäÔÚ±äÁ¿¶ÔÆë·½Ãæ¿ÉÄÜÓв»Í¬µÄÌØÐÔ¡£Òò´ËÔڽṹÌ嶨ÒåʱÈçºÎÉè¼Æ³ÉÔ±±äÁ¿µÄ˳ÐòÒÔÓÐЧ¼õÉÙÕ¼¾ÝµÄÄÚ´æ¿Õ¼ä£¬ÒÔ¼°ÈçºÎÌî³äÌض¨×ֶα£Ö¤·ÃÎʶÔÆëÎÊÌ⣬¶¼ÊÇǶÈëʽϵͳ½á¹¹ÌåÉè¼ÆʱӦ¸Ã¿¼ÂǵĿçƽ̨¿ÉÒÆÖ²ÐÔÎÊÌâ
7¡¢ ÈçºÎ½«unsigned
Ïà¹ØÎĵµ£º
ÈôÏëÔÚubuntuϱàÒëc/c++´úÂë
Ê×ÏÈ£¬°²×°g++ºÍgdb£¬¿ÉÒÔÔÚÐÂÁ¢µÃÖÐÖ±½Ó°²×°
ÈôÒª±àÒëc£¬È磺
££include
<stdio.h>
int main()
{
printf("Hello,World!\n");
return 0;
}
......
#include <stdio.h>
int main ()
{
FILE *fp1;
fp1=fopen("test0.txt","rt");
if(fp1==NULL)
{
printf("can not open test0.txt\n");return 0;
&n ......
ÎÒ²»ÖªµÀÕâƪÎÄÕµÄ×÷ÕßÊÇË£¬µ«ÎÒÖªµÀ£¬Ëû¶ÔjavaÓÐÒ»ÖÖºÜÉîµÄÀí½â£¬ÆäʵÎÄÕÂÖв¢Ã»ÓÐÌåÏÖ³ö×÷Õ߶Ôjava¼¼ÊõÉî²ãÀí½â£¬µ«ÊÇ´ÓÎÄÖеÄÿһ¾ä»°ÖУ¬ÎÒ¸ÐÊܵ½ÁËһЩ¶«Î÷¡£ÕâÊÇһƪºÜºÃµÄÎÄÕ£¬Ò²¿ÉÒÔ°ïÖúºÜ¶àÈËÃÔãµÄÈ˽â¾öÎÊÌâ¡£´øÀ´ºÍ´ó¼Ò·ÖÏíһϡ£
Ç°²»¾ÃCSDN¿¯µÇÁËһƪ¡¶CÓïÑÔÒѾËÀÁË¡·µÄÎÄÕ£¬ÒýÆðÁËһЩÕùÂÛ¡£ÆäʵÄÇÆ ......
ÉùÃ÷£º´ËÎĵĸ÷ÖÖâ«Ëö½â·¨×ª×Ôµç×Ó¿Æ´óÄÚÍøÂÛ̳£¬¶Ô£¬¾ÍÊÇ×î½üÒò”ÐíÔ¸ÃÅ“¶øÉϸ÷´óÐÂÎÅÍøÕ¾µÄѧУ¡£
ÌâÄ¿ÈçÏ£º
#include "stdio.h"
void print()
{
*
}
void main()
{
}
ÒªÇóÔÚ*ºÅ´¦Ìí¼ÓÓï¾ä£¬³ÌÐòÊä³öhello,world!
ºÃÁË£¬ÎÒÖ±½ÓÌù´ð°¸ÁË£¬ÏàÐÅ´ó¼Ò¶¼¿´µÃ¶®£¬ÓÐЩʵÔÚÊÇâ«Ëö¡£¡£¡ ......
CºÍC++ÓïÑÔѧϰ×ܽá(Ò»)
֪ʶ½á¹¹:
1¡¢if,for,switch,goto
2¡¢#define,const
3¡¢Îļþ¿½±´µÄ´úÂë,¶¯Ì¬Éú³ÉÄÚ´æ,¸´ºÏ±í´ïʽ,strcpy,memcpy,sizeof
4¡¢º¯Êý²ÎÊý´«µÝ,ÄÚ´æ·ÖÅ䷽ʽ,ÄÚ´æ´íÎó±íÏÖ,mallocÓënewÇø±ð
5¡¢ÀàÖØÔØ¡¢Òþ²ØÓ븲¸ÇÇø±ð,externÎÊÌâ,º¯Êý²ÎÊýµÄȱʡ
ÖµÎÊÌâ,ºê´úÂëÓëÄÚÁªº¯ÊýÇø±ð
6¡¢¹¹ÔìºÍÎö¹ ......