CÀàÐÍת»»
Ç¿ÖÆÀàÐÍת»»ÊÇͨ¹ýÀàÐÍת»»ÔËËãÀ´ÊµÏֵġ£ÆäÒ»°ãÐÎʽΪ£º (ÀàÐÍ˵Ã÷·û) (±í´ïʽ) Æ书ÄÜÊǰѱí´ïʽµÄÔËËã½á¹ûÇ¿ÖÆת»»³ÉÀàÐÍ˵Ã÷·ûËù±íʾµÄÀàÐÍ¡£ÀýÈ磺 (float) a °Ñaת»»ÎªÊµÐÍ(int)(x+y) °Ñx+yµÄ½á¹ûת»»ÎªÕûÐÍÔÚʹÓÃÇ¿ÖÆת»»Ê±Ó¦×¢ÒâÒÔÏÂÎÊÌ⣺
1.ÀàÐÍ˵Ã÷·ûºÍ±í´ïʽ¶¼±ØÐë¼ÓÀ¨ºÅ(µ¥¸ö±äÁ¿¿ÉÒÔ²»¼ÓÀ¨ºÅ)£¬Èç°Ñ(int)(x+y)д³É(int)x+yÔò³ÉÁË°Ñxת»»³ÉintÐÍÖ®ºóÔÙÓëyÏà¼ÓÁË¡£
2.ÎÞÂÛÊÇÇ¿ÖÆת»»»òÊÇ×Ô¶¯×ª»»£¬¶¼Ö»ÊÇΪÁ˱¾´ÎÔËËãµÄÐèÒª¶ø¶Ô±äÁ¿µÄÊý¾Ý³¤¶È½øÐеÄÁÙʱÐÔת»»£¬¶ø²»¸Ä±äÊý¾Ý˵Ã÷ʱ¶Ô¸Ã±äÁ¿¶¨ÒåµÄÀàÐÍ¡£
Àý1£º
main()
{
float f=5.75;
printf("(int)f=%d,f=%f\n",(int)f,f);
}
f<--5.75
½«float fÇ¿ÖÆת»»³Éint f float f=5.75;printf("(int)f=%d,f=%f\n",(int)f,f); ±¾Àý±íÃ÷£¬fËäÇ¿ÖÆתΪintÐÍ£¬µ«Ö»ÔÚÔËËãÖÐÆð×÷Ó㬠ÊÇÁÙʱµÄ£¬¶øf±¾ÉíµÄÀàÐͲ¢²»¸Ä±ä¡£Òò´Ë£¬(int)fµÄֵΪ 5(ɾȥÁËСÊý)¶øfµÄÖµÈÔΪ5.75¡£
Àý2£º
±ÈÈçÎÒÃÇ¿ÉÒÔ(int)'A'£¬ÕâÑùת»»ºóµÄ½á¹ûΪAµÄASCIIÂëÊýÖµ£¬ÒòΪÄÇ¿éÄÚ´æ±¾À´¾Í´æµÄÄǸöÊý£¬Ö»ÊÇ»»¸öÐÎʽʹÓöøÒÑ¡£ ÖªµÀÉÏÃæµÄÔÔò£¬ÎÒÃÇ¿ÉÒÔ¶ÔÈκÎÊý¾ÝÀàÐͽøÐÐת»»£¬µ«ÊÇת»»µÄ½á¹û¿ÉÄܲ»ÊÇÄãÏëÏñµÄ½á¹û£¬¾ÙÀý(int)'9'µÄ½á¹ûΪ¶àÉÙ£¿²»ÊÇ9¶øÊÇ0x39¡£À´¸ö¸ßÉîµãµÄprintf("%d",'12');µÄÊä³öÊÇʲô£¿ÕýÈ·´ð°¸ÊÇ12849£¬ÒòΪprintf("%d",'12'),´òÓ¡µÄÊÇ´æ´¢12µÄÄÚ´æµØÖ·ÉϵÄÄÚÈÝ£¬¼´ASCIIÂëÖµ£¬12µÄµÍλÊý´æ´¢ÔÚµÍλµØÖ·£¬¼´1´æ´¢ÔÚµÍ룬¸ßλ´æ´¢ÔÚ¸ßλµØÖ·£¬0x32¾ÍÊÇ2µÄASCIIÂ룬0x31¾ÍÊÇ1µÄASCIIÂ룬ËùÒÔÊÇ0x3231,ת»»³É10½øÖƾÍÊÇ12849£¡
¡ñ ×Ö·ûÐͱäÁ¿µÄֵʵÖÊÉÏÊÇÒ»¸ö8λµÄÕûÊýÖµ£¬Òò´ËÈ¡Öµ·¶Î§Ò»°ãÊÇ-128¡«127£¬charÐͱäÁ¿Ò²¿ÉÒÔ¼ÓÐÞÊηûunsigned£¬Ôòunsigned char ÐͱäÁ¿µÄÈ¡Öµ·¶Î§ÊÇ0¡«255(ÓÐЩ»úÆ÷°ÑcharÐ͵±×öunsighed charÐͶԴý£¬ È¡Öµ·¶Î§×ÜÊÇ0¡«255)¡£
¡ñ Èç¹ûÒ»¸öÔËËã·ûÁ½±ßµÄÔËËãÊýÀàÐͲ»Í¬£¬ÏÈÒª½«Æäת»»ÎªÏàͬµÄÀàÐÍ£¬¼´½ÏµÍÀàÐÍת»»Îª½Ï¸ßÀàÐÍ£¬È»ºóÔٲμÓÔËË㣬ת»»¹æÔòÈçÏÂͼËùʾ¡£
double ←©¤©¤ float ¸ß
↑
long
↑
unsigned
↑
int ←©¤©¤ char,short µÍ
¡ñ ͼÖкáÏò¼ýÍ·±íʾ±ØÐëµÄת»»£¬ÈçÁ½¸öfloatÐÍÊý²Î¼ÓÔËË㣬ËäÈ»ËüÃÇÀàÐÍÏàͬ£¬µ«ÈÔÒªÏÈת³ÉdoubleÐÍÔÙ½øÐÐÔËË㣬½á¹ûÒàΪdoubleÐÍ¡£ ×ÝÏò¼ýÍ·±íʾµ±ÔËËã·ûÁ½±ßµÄÔËËãÊýΪ²»Í¬ÀàÐÍʱµÄת»»£¬ÈçÒ»¸ölong ÐÍÊý¾ÝÓëÒ»¸öintÐÍÊý¾ÝÒ»ÆðÔËË㣬ÐèÒªÏȽ«intÐÍÊý¾Ýת»»ÎªlongÐÍ£¬ È»ºóÁ½ÕßÔÙ½øÐÐÔËËã£
Ïà¹ØÎĵµ£º
Ò»Ö±¶Ô½á¹¹ÌåŪµÄÄ£ºý£¬½ñÌìÖÕÓÚÓлú»á³ÎÇåÁË¡£Óиö´í£º²»Ã÷°×ûÓнṹÌåÃûµÄ½á¹¹ÌåÈçºÎÏñ½á¹¹ÌåÃûÒ»ÑùʹÓá£
typedf struct st ......
ÓüÇʱ¾Ð´C³ÌÐò£¬²¢±àÒë¡£ ¸Õ×°ºÃµÄϵͳ
ÖÐÒѾÓÐGCCÁË£¬µ«ÊÇÕâ¸öGCCʲôÎļþ¶¼²»ÄܱàÒ룬ÒòΪûÓÐһЩ±ØÐëµÄÍ·Îļþ£¬ËùÒÔÒª°²×°build-essentialÕâ¸öÈí¼þ
°ü£¬°²×°ÁËÕâ¸ö°ü»á×Ô¶¯°²×°ÉÏg++,libc6-dev,linux
-libc-dev,libstdc++6-4.1-devµÈһЩ±ØÐëµÄÈí¼þºÍÍ·ÎļþµÄ¿â¡£
¿ÉÒÔÔÚÐÂÁ¢µÃÀïÃæË ......
ÆÕͨ±äÁ¿ÊÇÖ±½Ó´«Öµshow(int a,int b)
Ö¸Õë±äÁ¿´«µÝµØÖ·show(int *a,int *b)
ÒýÓñäÁ¿ÊÇÒþʽ´«µØÖ· 1:int x;void show(int &x)£¬Êµ¼Ê´«µÝµÄÊÇxµÄµØÖ·p£¬µ«ÊǺ¯ÊýÄÚ²¿Ê¹ÓÃxʱ»á×Ô¶¯±ä³É*p
  ......
×Ô¼ºÐ´µÄC/C++±àÒëÆ÷Doctors[Èí¼þ+Îĵµ]
http://blog.csdn.net/huyansoft/archive/2009/08/20/4464772.aspx
¸üа汾1.0.1£º¸Ã°æ±¾½â¾öÁË֮ǰ1.0.0°æ±¾ÖÐÕÒ²»µ½Á´½Ó¿âlibc.libµÄÎÊÌ⣬ÒÔ¼°IDEϵã»÷Project²Ëµ¥³öÏÖµÄBUG¡£ÏÂÔصØÖ·£ºhttp://download.csdn.net/source/1597132
Doctors±àÒëÆ÷ÄÚ²¿ÊµÏÖ
For version 1.0.1 ......