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

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
{
               TH0=(65536-45872)/256;
               TL0=(65536-45872)%256;
               num++;
               if(num==20)
 {
               num=0;
               if(P1==0x00)
  {
              P1=0xFF;
  
  }
               else
               P1=P1>>1;
 }
}
Èç¹ûÔÚinterrupt·þÎñº¯ÊýÖУ¬ifÅжÏP1==0x00д³ÉP1=0x00£¬ÄǾͳöÏÖ±àÒ뾯ºÅ£¨²¢·Ç´íÎó£©
warning C276: constant in condition expression ¾¯¸æ¡£
½ñÌì¸É¸É¿ªÊ¼Ñ§Ï°£¬¾ÍÓöµ½ÁËÓÉÓÚ´ÖÐÄÒýÆðµÄÎÊÌâ¡£
¿´À´Ò»¸öºÃµÄ±à³ÌÏ°¹ßÊDZà³ÌÕßʵ¼ùµÄ±ØÒªËØÖÊ¡£


Ïà¹ØÎĵµ£º

¿¼²éǶÈëʽC¿ª·¢ÈËÔ±µÄ×îºÃµÄ0x10µÀÌâ

±àÕß°´
:·Ç³£»ù±¾¹ØÓÚCÓïÑÔµÄÎÊÌâ,Ò»¸öÐÅÏ¢Àà(¼ÆËã»ú,×ÊѶ¹¤³Ì,µç×Ó¹¤³Ì, ͨÐŹ¤³Ì)רҵµÄ±¾¿Æ±ÏÒµÉúÓ¦¸Ã´ïµ½µÄˮƽ¡£ÌâÄ¿²»ÄÑ,È«²¿¶¼ÄÜ¿ìËٵشðÍ꣬µ±È»Ò²ÐèÒªÒ»¶¨µÄ֪ʶ´¢±¸¡£
¶ÔÓÚ´ó¶àÊýÈË£¬ÎÒÃÇÔ¤ÆÚÄã¿ÉÄÜ´ð´í 3)   4)  15)Ì⣬ËùÒÔ´ð´í3µÀÒÔÄڵģ¬ÎÒÃÇÈÏΪÄãºÜ°ô
´ð´í5µÀÌâÒÔÄÚ£¬ÎÒÃÇÈÏΪÄ㻹²»´í(Ä ......

ÀûÓÃÊÀ½ç×îС×î¿ìµÄC±àÒëÆ÷´òÔì×Ô¼ºµÄC±à¼­Æ÷

ÀûÓÃÊÀ½ç×îС×î¿ìµÄC±àÒëÆ÷´òÔì×Ô¼ºµÄC±à¼­Æ÷
¼ò½étinycc ÊÀ½çÉÏ×îС±àÒëËÙ¶È×î¿ìµÄCÓïÑÔ±àÒëÆ÷ ¸÷ÏÄܽø¹Ù·½È¥¿´
TCC¹Ù·½ÏÂÔصØÖ·£ºhttp://ftp.twaren.net/Unix/NonGNU/tinycc/tcc-0.9.25-win32-bin.zip
ÎÒÖªµÀ ´ó¼Ò»ù±¾É϶¼ÓùýWIN—TC°É ÌرðÊÇÉϹý´óѧµÄ CÓïÑÔÈëÃÅʱÓõĶ¼ÊÇ
ËûµÄ²Ù×÷½çÃæÈçͼ
¹þ¹þ ¿´ÏÂÍ ......

¹ØÓÚC/C++ ±í´ïʽÇóֵ˳Ðò 䶨Òå

±í´ïʽµÄ¸±×÷ÓÃ
ÔËËã·ûµÄÓÅÏȼ¶Óë½áºÏÐԹ涨Á˱í´ïʽÖÐÏàÁÚÁ½¸öÔËËã·ûµÄÔËËã´ÎÐò£¬µ«¶ÔÓÚË«Ä¿
ÔËËãµÄ²Ù×÷Êý£¬C++ûÓй涨ËûÃǵļÆËã´ÎÐò¡£ÀýÈ磬¶ÔÓÚ±í´ïʽ£º
exp1 + exp2;
ÏȼÆËã exp1 »¹ÊÇ exp2£¿²»Í¬µÄ±àÒëÆ÷Óв»Í¬µÄ×ö·¨¡£
ÔÚÊýѧÉÏ£¬¶ÔÓÚË«Ä¿ÔËËã·û£¬²»ÂÛÏȼÆËãÄÄÒ»¸ö²Ù×÷Êý£¬ÒªÇó×îÖÕ¼ÆËã½á¹ûÒ»Ñù¡£
ÔÚ C++ ......

extern "C"Ïà¹ØµÄһЩϸ½ÚÎÊÌâ

×÷ÕߣºÊ¯Í·
extern "C"°üº¬Ë«Öغ¬Ò壬ÆäÒ»£º±»ËüÐÞÊεÄÄ¿±êÊÇ“extern”µÄ£»Æä¶þ£º±»ËüÐÞÊεÄÄ¿±êÊÇ“C”µÄ¡£
1£©±»extern “C”ÏÞ¶¨µÄº¯Êý»ò±äÁ¿ÊÇexternÀàÐ͵ģ»
    externÊÇC/C++ÓïÑÔÖбíÃ÷º¯ÊýºÍÈ«¾Ö±äÁ¿×÷Ó÷¶Î§£¨¿É¼ûÐÔ£©µÄ¹Ø¼ü×Ö£¬¸Ã¹Ø¼ü×Ö¸æËß±àÒëÆ÷£¬ÆäÉùÃ÷µÄº¯ ......

¹ØÓÚc,c++Êä³ö¸ñʽ¿ØÖÆ

1.
printf("%.9lf\n",sum); 
//Êä³öСÊýµãºó9λ²»Ê¡È¥Ä©Î²¶àÓàµÄ0
2.
printf("%.10g\n",sum);
 //Êä³öСÊýµãºó9λ²»Ê¡È¥Ä©Î²¶àÓàµÄ0
3.
#include<iomanip>
cout<<setprecision(10)<<sum<<endl;
//Êä³öСÊýµãºó9λʡȥĩβ¶àÓàµÄ0
4. 
#include<iomanip>
cout.pre ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ