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

c fopenº¯Êý

[CÓïÑÔ]fopen()º¯ÊýµÄ²ÎÊý˵Ã÷
2007Äê06ÔÂ05ÈÕ ÐÇÆÚ¶þ 23:55
¸ñʽ£ºÎļþÖ¸ÕëÃû=fopen(ÎļþÃû£¬Ê¹ÓÃÎļþ·½Ê½)
²ÎÊý£º
ÎļþÃû ÒâÒå
"C:/temp/temp.txt" Îļþ C:\temp\temp.txt
ÎļþʹÓ÷½Ê½ ¡¡ Òâ Òå
“rt”¡¡¡¡¡¡¡¡¡¡Ö»¶Á´ò¿ªÒ»¸öÎı¾Îļþ£¬Ö»ÔÊÐí¶ÁÊý¾Ý
“wt”¡¡¡¡¡¡¡¡    ֻд´ò¿ª»ò½¨Á¢Ò»¸öÎı¾Îļþ£¬Ö»ÔÊÐíдÊý¾Ý
“at”¡¡¡¡¡¡¡¡    ×·¼Ó´ò¿ªÒ»¸öÎı¾Îļþ£¬²¢ÔÚÎļþĩβдÊý¾Ý
“rb”¡¡¡¡¡¡¡¡   Ö»¶Á´ò¿ªÒ»¸ö¶þ½øÖÆÎļþ£¬Ö»ÔÊÐí¶ÁÊý¾Ý
“wb”¡¡¡¡¡¡¡¡   ֻд´ò¿ª»ò½¨Á¢Ò»¸ö¶þ½øÖÆÎļþ£¬Ö»ÔÊÐíдÊý¾Ý
“ab” ¡¡¡¡¡¡¡¡×·¼Ó´ò¿ªÒ»¸ö¶þ½øÖÆÎļþ£¬²¢ÔÚÎļþĩβдÊý¾Ý
“rt+”¡¡¡¡¡¡¡¡¶Áд´ò¿ªÒ»¸öÎı¾Îļþ£¬ÔÊÐí¶ÁºÍд¡£ÓÃfseekÈ·¶¨¶ÁдλÖã¬Ð´¶àÉÙ¸²¸Ç¶àÉÙ£¬
                          ºóÃæµÄÄÚÈݱ£Áô¡£ÒòΪ´ÅÅÌ¿Õ¼äÊÇÁ¬ÐøµÄ£¬ËùÒÔÄã²»ÄÜÔÚÖмä²åÈ룬ÔÚÖмäÒ»µ©
                           дÈë¾ÍÊǸ²¸ÇÓëдÈëÄÚÈݵȳ¤µÄÄÇЩÄÚÈÝ¡£
“wt+”¡¡¡¡¡¡¡¡¶Áд´ò¿ª»ò½¨Á¢Ò»¸öÎı¾Îļþ£¬ÔÊÐí¶Áд
“at+”¡¡¡¡¡¡¡¡¶Áд´ò¿ªÒ»¸öÎı¾Îļþ£¬ÔÊÐí¶Á£¬»òÔÚÎļþĩ׷¼ÓÊý¾Ý
“rb+”¡¡¡¡¡¡¡¡¶Áд´ò¿ªÒ»¸ö¶þ½øÖÆÎļþ£¬ÔÊÐí¶ÁºÍд
“wb+”¡¡¡¡¡¡¡¡¶Áд´ò¿ª»ò½¨Á¢Ò»¸ö¶þ½øÖÆÎļþ£¬ÔÊÐí¶ÁºÍд
“ab+” ¡¡¡¡¡¡¡¡¶Áд´ò¿ªÒ»¸ö¶þ½øÖÆÎļþ£¬ÔÊÐí¶Á£¬»òÔÚÎļþĩ׷¼ÓÊý¾Ý
¶ÔÓÚÎļþʹÓ÷½Ê½ÓÐÒÔϼ¸µã˵Ã÷£º
¡¡¡¡1. ÎļþʹÓ÷½Ê½ÓÉr,w,a,t,b£¬+Áù¸ö×Ö·ûÆ´³É£¬¸÷×Ö·ûµÄº¬ÒåÊÇ£º
¡¡¡¡r(read): ¶Á
¡¡¡¡w(write): д
¡¡¡¡a(append): ×·¼Ó
¡¡¡¡t(text): Îı¾Îļþ£¬¿ÉÊ¡ÂÔ²»Ð´
¡¡¡¡b(banary): ¶þ½øÖÆÎļþ
¡¡¡¡+: ¶ÁºÍд
¡¡¡¡2. ·²ÓÓr”´ò¿ªÒ»¸öÎļþʱ£¬¸ÃÎļþ±ØÐëÒѾ­´æÔÚ£¬ÇÒÖ»ÄÜ´Ó¸ÃÎļþ¶Á³ö¡£
¡¡¡¡3. ÓÓw”´ò¿ªµÄÎļþÖ»ÄÜÏò¸ÃÎļþдÈë¡£Èô´ò¿ªµÄÎļþ²»´æÔÚ£¬ÔòÒÔÖ¸¶¨µÄÎļþÃû½¨Á¢¸ÃÎļþ£¬Èô´ò¿ªµÄÎļþÒѾ­´æÔÚ£¬Ôò½«¸ÃÎļþɾȥ£¬Öؽ¨Ò»¸öÐÂÎļþ¡£
¡¡¡¡4. ÈôÒªÏòÒ»¸öÒ


Ïà¹ØÎĵµ£º

C++/Cºê¶¨ÒåÖÐ## Á¬½Ó·ûÓë# ·ûµÄº¬Òå

## Á¬½Ó·ûÓë# ·û
¡¡¡¡## Á¬½Ó·ûºÅÓÉÁ½¸ö¾®ºÅ×é³É£¬Æ书ÄÜÊÇÔÚ´ø²ÎÊýµÄºê¶¨ÒåÖн«Á½¸ö×Ó´®(token)Áª½ÓÆðÀ´£¬´Ó¶øÐγÉÒ»¸öеÄ×Ó´®¡£µ«Ëü²»¿ÉÒÔÊǵÚÒ»¸ö»òÕß×îºóÒ»¸ö×Ó´®¡£ËùνµÄ×Ó´®(token)¾ÍÊÇÖ¸±àÒëÆ÷Äܹ»Ê¶±ðµÄ×îСÓï·¨µ¥Ôª¡£¾ßÌåµÄ¶¨ÒåÔÚ±àÒëÔ­ÀíÀïÓÐÏ꾡µÄ½âÊÍ£¬µ«²»ÖªµÀÒ²ÎÞËùν¡£Í¬Ê±ÖµµÃ×¢ÒâµÄÊÇ#Á¬½Ó·ûÊÇ°Ñ´«µÝ¹ý ......

LinuxÏÂc¿ª·¢ Ö® Ïß³ÌͨÐÅ

1.Linux“Ï߳̔
     ½ø³ÌÓëÏß³ÌÖ®¼äÊÇÓÐÇø±ðµÄ£¬²»¹ýLinuxÄÚºËÖ»ÌṩÁËÇáÁ¿½ø³ÌµÄÖ§³Ö£¬Î´ÊµÏÖÏß³ÌÄ£ÐÍ¡£LinuxÊÇÒ»ÖÖ“¶à½ø³Ìµ¥Ï߳̔µÄ²Ù×÷ϵͳ¡£Linux±¾ÉíÖ»Óнø³ÌµÄ¸ÅÄ¶øÆäËùνµÄ“Ï߳̔±¾ÖÊÉÏÔÚÄÚºËÀïÈÔÈ»Êǽø³Ì¡£
     ´ó¼Ò ......

´ÓCµ½JAVA£¬¿ªÊ¼ÎÒµÄIT²ËÄñ֮·£¡

ÕæÕý·¢ÏÖÈËÉúÐèҪ֪ʶµÄʱºò£¬ÎÒµÄÇà´ºÒѾ­ÀË·ÑÁËÒ»°ë¡£
ÓÚÊǹÄÆðÓÂÆøÀ´µ½±±´óÇàÄñѧϰIT£¬¼øÓڶ෽¿¼ÂÇ£¬»¹ÊÇÑ¡ÔñÁËÈí¼þ²âÊÔ¡£
Èç½ñ¿ÎÒµµÄÒ»´ó°ëÒ²ÒѽáÊø£¬´Ó¸Õ¿ªÊ¼µÄÒ»ÎÞËùÖª£¬½¥½¥³É³¤ÎªÒ»¸ö²ËÄñ……
Ôڿγ̵Äѧϰ¹ý³ÌÖУ¬²Å½¥½¥·¢ÏÖ×Ô¼º¶ÔÓÚÕâ¸öÐÐÒµµÄÐËȤ£¬ÓÈÆäÊÇÈí¼þ¿ª·¢ÕâÒ»¿é¡£
ÉõÖÁ¶Ô×Ô¼ºÑ¡Ôñ×ö²â ......

C/C++»ñÈ¡µ±Ç°ÏµÍ³Ê±¼ä(תÔØ)


// ·½°¸— Óŵ㣺½öʹÓÃC ±ê×¼¿â£»È±µã£ºÖ»Äܾ«È·µ½Ã뼶
#include <time.h>
#include <stdio.h>
int main( void )
{
    time_t t = time(0);
    char tmp[64];
    strftime( tmp, sizeof(tmp), "%Y/%m/%d %X %A ±¾ÄêµÚ%jÌì %z",localtim ......

±í´ïʽÇóÖµ Êý¾Ý½á¹¹ C/C++ Õ»µÄÓ¦ÓÃ

ÓÃÊéÉϵĴúÂëÆ´´ÕµÄ£¬»¹ÊǺÜÓгɾ͸еĹþ
Ö§³ÖµÄÔËËã·ûºÅÓÐ"+","-","*","/","(",")","#"¡£
Ö§³Ö20λÒÔÄÚÎÞ·ûºÅÕûÊý£¬µ±È»¿ÉÒÔºÜÈÝÒ׵ĸijÉÓзûºÅ»òÕßÊÇʵÐÍÊý
#include<stdio.h>
#include<string.h>
#include<stdlib.h>
#define OPSETSIZE 7
//º¯Êý½á¹û״̬´úÂë
#define TRUE 1
#define FALSE 0 ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ