Ò׽ؽØͼÈí¼þ¡¢µ¥Îļþ¡¢Ãâ°²×°¡¢´¿ÂÌÉ«¡¢½ö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Ôò´Ó±ê×¼ÊäÈëÁ÷ÖÐ


Ïà¹ØÎĵµ£º

SQLite C/C++½Ó¿Ú½éÉÜ

ÕâƪÎÄÕÂÊÇʹÓÃSQLite C/C++½Ó¿ÚµÄÒ»¸ö¸ÅÒª½éÉܺÍÈëÃÅÖ¸ÄÏ¡£
ÓÉÓÚÔçÆÚµÄSQLiteÖ»Ö§³Ö5¸öC/C++½Ó¿Ú£¬Òò¶ø·Ç³£ÈÝÒ×ѧϰºÍʹÓ㬵«ÊÇËæ×ÅSQLite¹¦ÄܵÄÔöÇ¿£¬ÐµÄC/C++½Ó¿Ú²»¶ÏµÄÔö¼Ó½øÀ´£¬µ½ÏÖÔÚÓг¬¹ý150¸ö²»Í¬µÄAPI½Ó¿Ú¡£ÕâÍùÍùʹ³õѧÕßÍû¶øÈ´²½¡£ÐÒÔ˵ÄÊÇ£¬´ó¶àÊýSQLiteÖеÄC/C++½Ó¿ÚÊÇרÓõģ¬Òò¶øºÜÉÙ±»Ê¹Óõ½¡£¾¡¹ÜÓÐÕâ ......

C breakÌø³ö¶à²ãÑ­»·

 ÔÚC/C++ÖУ¬Ìø³ö¶à²ãÑ­»·ÓÐ3Öз½·¨£º
  1.ÓÃbreak;¼ÓÉÏÒ»¸ö¸¨ÖúµÄ±êÖ¾±äÁ¿¡£  
  2.ÓÃgoto;  
  3.ÓÃtry   ...   catch;
ÆäÖÐbreak¶Ôif-elseÓï¾äÎÞЧ£¬Ã¿´ÎʹÓÃÖ»ÄÜÌø³öÒ»²ãÑ­»·¡£
ÓÃbreakµÄ¾ßÌå·½·¨Îª£º
bool BREAK=false;
while(...){
for(...){ ......

±ê×¼CµÄfopenÏêϸʹÓÃ


¸ñʽ£ºÎļþÖ¸ÕëÃû=fopen(ÎļþÃû£¬Ê¹ÓÃÎļþ·½Ê½)
²ÎÊý£º
ÎļþÃû ÒâÒå
"C:\\TC\\qwe.txt" ÎļþC:\TC\qwe.txt
"qwe.txt" ºÍ³ÌÐòÔÚͬһĿ¼ÏµÄqwe.txt
ÎļþʹÓ÷½Ê½ ¡¡ Òâ Òå
“rt”¡¡¡¡¡¡¡¡¡¡¡¡Ö»¶Á´ò¿ªÒ»¸öÎı¾Îļþ£¬Ö»ÔÊÐí¶ÁÊý¾Ý
“wt”¡¡¡¡¡¡¡¡¡¡¡¡Ö»Ð´´ò¿ª»ò½¨Á¢Ò»¸öÎı¾Îļþ£¬Ö»ÔÊÐíдÊý¾Ý ......

C/SÓëB/S

¡¡B/S½á¹¹£¬¼´Browser/Server(ä¯ÀÀÆ÷/·þÎñÆ÷
)½á¹¹£¬ÊÇËæ×Å
Internet¼¼ÊõµÄÐËÆ𣬶ÔC/S½á¹¹µÄÒ»Öֱ仯»òÕ߸ĽøµÄ½á¹¹¡£ÔÚÕâÖֽṹÏ£¬Óû§½çÃæÍêȫͨ¹ýWWWä¯ÀÀÆ÷ʵÏÖ£¬Ò»²¿·ÖÊÂÎñÂß¼­ÔÚÇ°¶ËʵÏÖ£¬µ«ÊÇ
Ö÷ÒªÊÂÎñÂß¼­ÔÚ·þÎñÆ÷
¶ËʵÏÖ£¬ÐγÉËùν
3-tier½á¹¹¡£B/S½á¹¹£¬Ö÷ÒªÊÇÀûÓÃÁ˲»¶Ï³ÉÊìµÄWWWä¯ÀÀÆ÷¼¼Êõ£¬½áºÏä¯ÀÀÆ÷µÄ ......

C ÖÐtypedefµÄһЩʹÓÃ

1. »ù±¾½âÊÍ
¡¡¡¡typedefΪCÓïÑԵĹؼü×Ö£¬×÷ÓÃÊÇΪһÖÖÊý¾ÝÀàÐͶ¨ÒåÒ»¸öÐÂÃû×Ö¡£ÕâÀïµÄÊý¾ÝÀàÐÍ°üÀ¨ÄÚ²¿Êý¾ÝÀàÐÍ£¨int,charµÈ£©ºÍ×Ô¶¨ÒåµÄÊý¾ÝÀàÐÍ£¨structµÈ£©¡£
¡¡¡¡ÔÚ±à³ÌÖÐʹÓÃtypedefÄ¿µÄÒ»°ãÓÐÁ½¸ö£¬Ò»¸öÊǸø±äÁ¿Ò»¸öÒ×¼ÇÇÒÒâÒåÃ÷È·µÄÐÂÃû×Ö£¬ÁíÒ»¸öÊǼò»¯Ò»Ð©±È½Ï¸´ÔÓµÄÀàÐÍÉùÃ÷¡£
¡¡¡¡ÖÁÓÚtypedefÓÐʲô΢ÃîÖ®´ ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ