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

C±ê×¼¿âÔ´Âë½âÆÊ(13)£ºÊäÈëÊä³öº¯Êýstdio.h

    C±ê×¼ÖеÄI/O¿âÊÇÒ»¸ö±È½ÏÅÓ´óµÄ¿â£¬ÊµÏÖÒ²±È½Ï¸´ÔÓ¡£ÏÔÈ»I/O¿âµÄʵÏÖÊÇÒÀÀµÓÚ²Ù×÷ϵͳµÄ£¬²»Í¬µÄϵͳÉÏI/O¿âµÄʵÏÖ»úÀíÊDz»Ò»ÑùµÄ¡£glibcÖУ¬I/O¿âµÄºËÐÄʵÏÖÔÚlibioĿ¼Ï¡£ÓÐ4¸öÍ·Îļþlibio.h, iolibio.h, libioP.h, strfile.h, stdio.h£¬ÆäÖÐstdio.hÊǵ¼³öµÄ±ê×¼CÍ·Îļþ£¬ÆäÓ඼ÊÇÄÚ²¿ÊµÏÖ¡£ÕâÀï²¢²»´òËã½âÆÊÕû¸öI/O¿âµÄÔ´´úÂ루ÄÇÑù¿ÉÄÜÒ»±¾ÊéҲ˵²»Í꣩£¬Ö»ÊǸÅÊöÐԵĽéÉÜÒ»ÏÂËüµÄÂÖÀªºÍËùÓбê×¼½Ó¿ÚµÄ¹¦ÄÜ¡£ÎÒÃÇѧϰI/O¿âÒ²ÊÇΪÁËÄÜÔÚʵ¼ùÖÐÓ¦ÓÃËü£¬Òò´ËÒò´Ë¶ÔC±ê×¼ÖÐËùÓеÄI/O½Ó¿ÚÒªÓиöÈ«ÃæµÄÁ˽⡣
    ÊäÈë/Êä³öº¯ÊýÖ÷ÒªÔÚstdio.hÖУ¬¶ÔÓ¦µÄ¿í×Ö·û°æ±¾ÔÚwchar.hÖУ¬ÏÂÃæÁгö±ê×¼CÖж¨ÒåµÄËùÓнӿڣº
    1¡¢Ïà¹ØÀàÐͺͳ£Á¿£ºFILE¡¢EOFÔÚstdio.hÖУ»wchar_t¡¢wint_t¡¢WEOF¡¢WCHAR_MAX¡¢WCHAR _MINµÈÔÚwchar.hÖж¨Òå¡£size_tºÍNULLÔÚstdio.h, wchar.hºÍstddef.h¾ù»á¶¨Ò壬ͬʱʹÓÃÆäÖеĶà¸öÍ·ÎļþÊÇÎÞº¦µÄ¡£
    2¡¢fopen,fclose,fflush,frepoen,fwide,FOPEN_MAX,FILENAME_MAX£º´ò¿ªÎļþ²¢·µ»ØÊý¾ÝÁ÷¡¢¹Ø±ÕÎļþ¡¢Çå¿ÕÊý¾ÝÁ÷µÄ»º³åÇø¡¢½«ÎļþÖØйØÁªµ½Ò»¸öÊý¾ÝÁ÷¡¢fwideÔÚwchar.hÖÐÓÃÓÚÉèÖÃÓë²âÊÔÁ÷¶¨Ïò¡¢¿ÉÒÔͬʱ´ò¿ªµÄÊý¾ÝÁ÷×î´ó¸öÊý¡¢ÎļþÃûµÄ×î´ó³¤¶È¡£
    Îļþ·ÃÎÊ·½Ê½£º”r”¡¢”w”¡¢”a”¡¢”r+”¡¢”w+”¡¢”a+”£¬ËùÓзÃÎÊ·½Ê½ºóÃ涼¿ÉÒÔ¼ÓÉÏ×Öĸb£¬±íʾÊý¾ÝÁ÷±£´æ¶þ½øÖÆÊý¾Ý£¬¶ø²»ÊÇ×Ö·ûÊý¾Ý¡£
    3¡¢setvbuf,setbuf,BUFSIZ,_IOFBF,_IOLBF,_IONBF£ºÉèÖÃÊý¾ÝÁ÷µÄ»º³åÇø¡¢BUFSIZ»º³åÇøµÄĬÈϳ¤¶È¡¢ºóÃæÈý¸öÊÇ»º³åģʽ£¬ÎªÊýÍêÈ«»º³å¡¢Ðлº³å£¨Ð´Èë»»Ðзû»ò»º³åÇøÂúʱˢлº³åÇø£©¡¢Êý¾ÝÁ÷²»»º³å¡£
    4¡¢stdin,stdout,stderr£º±ê×¼ÊäÈëÁ÷¡¢Êä³öÁ÷¡¢´íÎóÁ÷¡£³ýstderrÖ®Í⣬ÁíÍâÁ½¸öÊý¾ÝÁ÷¶¼»º³å¡£CÓïÑÔ³ÌÐòÖ´ÐÐʱ£¬»áÔ¤ÏÈ´ò¿ªÕâ3ÖÖÎı¾Á÷¡£
    5¡¢fseek,ftell,rewind,fgetops,fsetpos£ºÉèÖÃÁ÷µÄ¶ÁдλÖᢷµ»ØÁ÷µÄµ±Ç°¶ÁдλÖᢽ«Á÷µÄλÖûָ´µ½¿ªÍ·¡¢fgetpos/fsetposÓÃÓÚ»ñÈ¡»òÉèÖÃÁ÷µÄλÖã¬ÆäÖµ·ÅÔÚfpos_tÀàÐ͵IJÎÊýÖС£¶¨Î»ÂëÓÐSEEK_SET, SEEK_CUR,SEEK_END¡£
    6¡¢fgetc,fgetwc,getc,getwc,getchar,getwchar,ungetc,ungetwc£º´ÓÁ÷ÖжÁÈ¡ÏÂÒ»¸ö×Ö·û²¢×÷ΪintÀàÐ͵ÄÖµ·µ»Ø¡¢getcharÔò´Ó±ê×¼ÊäÈëÁ÷ÖÐ


Ïà¹ØÎĵµ£º

CÖг£Á¿²ÎÓëÔËËãµÄÎÊÌâ

×î½üÔÚ¿ª·¢ÖУ¬¶Ô³£Á¿²ÎÓëÔËËãʱºò£¬³öÁ˼¸¸öÎÊÌ⣬ÌؼǼÈçÏ£º
1.Àý×ÓÒ»£¨KEIL-51£©
   unsigned char recsum,xorsum;
   recsum == 0xFF; 
   xorsum == 0x00;
   if(recsum != (xorsum-1))  //Õâʱºò²»ÏàµÈ
   if(recsum != (unsigned ch ......

C/C++ ±ÊÊÔ¡¢ÃæÊÔÌâÄ¿´ó»ã×Ü(1)

һλͬѧÕûÀíµÄ³£¼û±ÊÊÔ/ÃæÊÔÌâÄ¿£¬´ð°¸½ö¹©²Î¿¼£¬²»´ú±í±¾È˹۵㡣
Õâ¸ö¶«Î÷ÓÐЩ²Î¿¼¼ÛÖµ,ºÍͬѧÌÖÂÛһϷ¢ÏÖ»¹ÊÇÓÐЩ´íÎó,
1£®ÒÑÖªstrcpyº¯ÊýµÄÔ­ÐÍÊÇ£º
char * strcpy(char * strDest,const char * strSrc);
1.²»µ÷Óÿ⺯Êý£¬ÊµÏÖstrcpyº¯Êý¡£
2.½âÊÍΪʲôҪ·µ»Øchar *¡£
½â˵£º
1.strcpyµÄʵÏÖ´úÂë
char * st ......

C/C++±àÒëÆ÷


ºÍÔÚIDEÖбàÒëÏà±È£¬ÃüÁîÐÐģʽ±àÒëËٶȸü¿ì£¬²¢¿ÉÒÔ±ÜÃâ±»IDE²úÉúµÄһЩ¸½¼ÓÐÅÏ¢Ëù¸ÉÈÅ¡£±¾ÎĽ«½éÉÜ΢ÈíC/C++±àÒëÆ÷ÃüÁîÐÐģʽÉ趨ºÍÓ÷¨¡£
 
1¡¢ÉèÖû·¾³±äÁ¿£º
PATH=C:\Program Files\Microsoft Visual Studio 8\VC\bin
INCLUDE=C:\Program Files\Microsoft Visual Studio 8\VC\include
LIB=C:\Program File ......

c·ÖÎöÃæÏò¶ÔÏóµÄʵÏÖ¼¼Êõ

ÃæÏò¶ÔÏó±à³ÌºÍ½á¹¹»¯±à³Ì¼¸ºõÔÚͬһʱÆÚ³öÏÖ¡£µ«ÊÇÓÉÓÚÔçЩʱºòµÄ»úÆ÷»·¾³²»ÔÊÐí£¬ÈçÄÚ´æ¡¢cpuµÈ¡£µ¼ÖÂÃæÏò¶ÔÏó¼¼ÊõûÓеõ½¼°Ê±µÄ·¢Õ¹£¬¶øͬʱÒòΪ½á¹¹»¯³ÌÐò¶ÔÓ²¼þÒªÇó²»ÊÇÄÇôǿÁÒ£¬ËùÒÔ¼°Ê±µÄ·¢Õ¹ÆðÀ´ÁË¡£
µ«ÊÇËäÈ»Èç´Ë£¬¸ü¶àµÄÈËÔÚ̸µ½ÃæÏò¶ÔÏóʱ×ܾõµÃÊÇÖÖÓÅÔ½£¬×ܾõµÃ"¸ßÈËÒ»µÈ"£¬×ÔÈÏΪc++Ò»¶¨±ÈcÓÅÐã¡£ÏÂÃæͨ¹ýÓ ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ