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

GNU C library ±Ê¼Ç1

ÄÚÈÝ£ºIntroduction ºÍ Error Reporting
1. glibc ËùʵÏÖÈ«²¿»ò²¿·Ö¹æ·¶ÏµĹ¦ÄÜÓÐ
ISO C: The international standard for the C programming language.
POSIX: The ISO/IEC 9945 (aka IEEE 1003) standards for operating systems.
Berkeley Unix: BSD and SunOS.
SVID: The System V Interface Description.
XPG: The X/Open Portability Guide.
Èç¹ûÖ»ÐèÒª ISO C µÄ¹¦ÄÜ£¬ÄÜÔÚ±àÒëʱʹÓà -ansi Ñ¡Ïî¡£glibc ʵÏÖÁËÈ«²¿µÄ ISO C ¹¦ÄÜ¡£POSIX ÊÇ ISO C µÄ³¬¼¯£¬Ëû¶îÍâµÄ°üÀ¨ÁË file system interface primitives¡¢device-specific terminal control functions¡¢process control functions¡£Berkeley Unix ʵÏÖÁËÇ°Á½Õ߶àÊý¹¦ÄÜ£¬Ô´ÓÚ 4.2 BSD¡¢4.3 BSD, and 4.4 BSD Unix ϵͳ£¨Ò»°ã³ÆΪ Berkeley Unix£©¼° SunOS £¨»ùÓÚ 4.2 BSD ²»¹ýÓÖʵÏÖÁË System V µÄ²¿·Ö¹¦ÄÜ£©£¬Ëû¶îÍâµÄ°üÀ¨ÁË symbolic links¡¢the select function¡¢BSD signal functions¡¢sockets¡£SVID ÊÇ System V Interface Description£¬Ò²¾ÍÊÇÃèÊö AT&T Unix System V operating system µÄÒ»·ÝÎļþ£¬Ä³ÖÖÒâÒåÉÏÊÇ POSIX µÄ³¬¼¯£¬²»¹ýûÓÐÒÑÓÐµÄ Unix ʵÏÖÁËÆäÈ«²¿¹¦ÄÜ£¬glibc Ò²½ö½öʵÏÖÁËÆ䲿·Ö¹¦ÄÜ¡£Ëû¶îÍâʵÏֵŦÄÜ°üÀ¨ the methods for inter-process communication£¨IPC£©¡¢shared memory¡¢hsearch¡¢drand48 ϵÁк¯Êý¡¢fmtmsg¡¢Ò»Ð©ÆäËûµÄÊýѧº¯Êý¡£XPG£¨The X/Open Portability Guide£©ÃèÊöÁËʲôÑùµÄϵͳÂú×ãÀà Unix ϵͳµÄ»ù±¾ÐèÒª£¬glibc ·þ´Ó¸ÃÐèÇó¡£
2. Í·ÎļþÀïÃæijЩº¯ÊýµÄʵÏÖʹÓà macro ×öµ½µÄ£¬ÀíÓÉÊÇÒ»°ãÕâÑù»á¸ü¿ì¡£²»¹ý²»±Ø²î±ðËûÃÇ£¬ÒòΪһ°ã¶¨ÒåÁËͬÃûµÄº¯Êý£¬Èç abs(int) ¼ÈÓк¯Êý¶¨ÒåÒ²ÓÐ macro ¶¨Ò壬ʹÓà & ²Ù×÷ʱ£¬ÓÉÓÚ macro µ÷ÓÃʱ²»ÄÜÆ¥Åäµ½ () Òò´ËÈÔÈ»ÄÜÈ¡µ½º¯ÊýµÄµØÖ·¡£Èç¹ûÐèÒªÏÔʽµÄµ÷Óú¯ÊýÄÜÓà () ½«º¯ÊýÃû°üΧ£¬Èç (abs)(3)£¬ÓÖ»òʹÓà #undef abs ½«¶¨Òå¹ýµÄ macro È¡Ïû¡£
3. ISO C ÔÊÐíÖظ´ #include Í·Îļþ£¬²»¹ý glibc ʹÓÃÁË #define #ifndef µÈÔ¤´¦ÀíÆ÷ÃüÁî±ÜÃâÁËͬһͷÎļþÖظ´×°ÔØ£¬Òò´ËÄÜ·ÅÐÄµÄ #include glibc µÄÍ·Îļþ¡£
4. ³ýÁË ISO C ¶¨ÒåµÄһЩ±£Áô×Ö£¬ÓÉÓÚ glibc ʵÏÖÁËһЩ¶îÍâµÄ¹¦ÄÜ£¬½¨Ò鲻ҪʹÓÿÉÄܺÍÖ®³åÍ»µÄһЩÃüÃû·½Ê½¡£
5. Ôõô¿ªÆôijÖÖ±ê׼Ϡglibc µÄ¹¦ÄÜ¡£Ç°ÃæÌáµ½ÄÜÀûÓà -ansi ½ö½öʹÓà ISO C ÒÔÄڵŦÄÜ¡£ÆäËûµÄͨ¹ý¶¨Òå macro ʵÏÖÌõ¼þ±àÁª£¬ÊµÏÖ·½Ê½·ÖÁ½ÖÖ£¬ÄÜÔÚ .c ÀïÃæ #define£¬»òÓÃ


Ïà¹ØÎĵµ£º

C/C++Êý×éÃûÓëÖ¸ÕëÇø±ð

 ÒÔÏÂÎÄÕÂתÔØÓÚ:ΪÁËѧϰºÍÊÕ²Ø
http://tech.163.com/school · 2005-08-23 11:05:18 · À´Ô´: Ì켫Íø
C/C++Êý×éÃûÓëÖ¸ÕëÇø±ð
¡¡¡¡ÒýÑÔ
¡¡¡¡Ö¸ÕëÊÇC/C++ÓïÑÔµÄÌØÉ«£¬¶øÊý×éÃûÓëÖ¸ÕëÓÐÌ«¶àµÄÏàËÆ£¬ÉõÖÁºÜ¶àʱºò£¬Êý×éÃû¿ÉÒÔ×÷ΪָÕëʹÓá£ÓÚÊǺõ£¬ºÜ¶à³ÌÐòÉè¼ÆÕ߾ͱ»¸ãºýÍ¿ÁË¡£¶øÐí¶àµÄ´óѧÀÏʦ£¬ËûÃÇ ......

²âÊÔ¶ÔCµÄÕÆÎճ̶È

 
ÏÂÃæÕâ¸ö³ÌÐòÊä³öʲô£¿
enum {false,true};
int main()
{
int i=1;
do
{
printf("%d\n",i);
i++;
if(i < 15)
continue;
}while(false);
return 0;
}
ÄãÏàÐÅô£¿ÏÂà ......

´ÓÁ½µÀ¾­µäÊÔÌâ̸C/C++ÖÐÁªºÏÌ壨union£©µÄʹÓÃ


´ÓÁ½µÀ¾­µäÊÔÌâ̸C/C++ÖÐÁªºÏÌ壨union£©µÄʹÓÃ
ÊÔÌâÒ»£º±àдһ¶Î³ÌÐòÅжÏϵͳÖеÄCPUÊÇLittle endian»¹ÊÇBig endianģʽ£¿
·ÖÎö£º
×÷Ϊһ¸ö¼ÆËã»úÏà¹ØרҵµÄÈË£¬ÎÒÃÇÓ¦¸ÃÔÚ¼ÆËã»ú×é³ÉÖж¼Ñ§Ï°¹ýʲô½ÐLittle endianºÍBig endian¡£Little endianºÍBig endianÊÇCPU´æ·ÅÊý¾ÝµÄÁ½ÖÖ²»Í¬Ë³Ðò¡£¶ÔÓÚÕûÐÍ¡¢³¤ÕûÐ͵ÈÊý¾ÝÀàÐÍ£ ......

CÌâÄ¿3

1. ÓÃÔ¤´¦ÀíÖ¸Áî#define ÉùÃ÷Ò»¸ö³£Êý£¬ÓÃÒÔ±íÃ÷1ÄêÖÐÓжàÉÙÃ루ºöÂÔÈòÄêÎÊÌ⣩
#define SECONDS_PER_YEAR   (60 * 60 * 24 * 365)UL
ÎÒÔÚÕâÏë¿´µ½¼¸¼þÊÂÇ飺
     1). #define Óï·¨µÄ»ù±¾ÖªÊ¶£¨ÀýÈ磺²»ÄÜÒԷֺŽáÊø£¬À¨ºÅµÄʹÓ㬵ȵȣ©
     2). ¶®µÃÔ¤´¦ÀíÆ÷½«Î ......

C++ÖÐextern ¡°C¡±º¬ÒåÉî²ã̽Ë÷

(ת)C++ÖÐextern “C”º¬ÒåÉî²ã̽Ë÷
 
 
1.ÒýÑÔ
¡¡¡¡C++ÓïÑԵĴ´½¨³õÖÔÊÇ“a better C”£¬µ«ÊÇÕâ²¢²»Òâζ×ÅC++ÖÐÀàËÆCÓïÑÔµÄÈ«¾Ö±äÁ¿ºÍº¯ÊýËù²ÉÓõıàÒëºÍÁ¬½Ó·½Ê½ÓëCÓïÑÔÍêÈ«Ïàͬ¡£×÷ΪһÖÖÓûÓëC¼æÈݵÄÓïÑÔ£¬C++±£ÁôÁËÒ»²¿·Ö¹ý³ÌʽÓïÑÔµÄÌص㣨±»ÊÀÈ˳ÆΪ“²»³¹µ×µØÃæÏò¶ÔÏó&rdquo ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ