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

C/C++ Îļþ¶Áд²Ù×÷×ܽá

ÔÚ±à³ÌµÄ¹ý³ÌÖУ¬ÎļþµÄ²Ù×÷ÊÇÒ»¸ö¾­³£Óõ½µÄÎÊÌ⣬ÔÚC++BuilderÖУ¬¿ÉÒÔʹÓöàÖÖ·½·¨¶ÔÎļþ²Ù×÷£¬ÏÂÃæÎҾͰ´ÒÔϼ¸¸ö²¿·Ö¶Ô´Ë×÷Ïêϸ½éÉÜ£¬¾ÍÊÇ£º
1¡¢»ùÓÚCµÄÎļþ²Ù×÷£»
2¡¢»ùÓÚC++µÄÎļþ²Ù×÷£»
3¡¢»ùÓÚWINAPIµÄÎļþ²Ù×÷£»
4¡¢»ùÓÚBCB¿âµÄÎļþ²Ù×÷£»
5¡¢ÌØÊâÎļþµÄ²Ù×÷¡£
¡¡
Ò¼¡¢»ùÓÚCµÄÎļþ²Ù×÷
¡¡¡¡ÔÚANSI CÖУ¬¶ÔÎļþµÄ²Ù×÷·ÖΪÁ½ÖÖ·½Ê½£¬¼´Á÷ʽÎļþ²Ù×÷ºÍI/OÎļþ²Ù×÷£¬ÏÂÃæ¾Í·Ö±ð½éÉÜÖ®¡£
Ò»¡¢Á÷ʽÎļþ²Ù×÷
¡¡¡¡ÕâÖÖ·½Ê½µÄÎļþ²Ù×÷ÓÐÒ»¸öÖØÒªµÄ½á¹¹FILE£¬FILEÔÚstdio.hÖж¨ÒåÈçÏ£º
typedef struct {
int level; /* fill/empty level of buffer */
unsigned flags; /* File status flags */
char fd; /* File descriptor */
unsigned char hold; /* Ungetc char if no buffer */
int bsize; /* Buffer size */
unsigned char _FAR *buffer; /* Data transfer buffer */
unsigned char _FAR *curp; /* Current active pointer */
unsigned istemp; /* Temporary file indicator */
short token; /* Used for validity checking */
} FILE; /* This is the FILE object */
¡¡¡¡FILEÕâ¸ö½á¹¹°üº¬ÁËÎļþ²Ù×÷µÄ»ù±¾ÊôÐÔ£¬¶ÔÎļþµÄ²Ù×÷¶¼ÒªÍ¨¹ýÕâ¸ö½á¹¹µÄÖ¸ÕëÀ´½øÐУ¬´ËÖÖÎļþ²Ù×÷³£Óõĺ¯Êý¼ûÏÂ±í º¯Êý ¹¦ÄÜ
fopen() ´ò¿ªÁ÷
fclose() ¹Ø±ÕÁ÷
fputc() дһ¸ö×Ö·ûµ½Á÷ÖÐ
fgetc() ´ÓÁ÷ÖжÁÒ»¸ö×Ö·û
fseek() ÔÚÁ÷Öж¨Î»µ½Ö¸¶¨µÄ×Ö·û
fputs() д×Ö·û´®µ½Á÷
fgets() ´ÓÁ÷ÖжÁÒ»ÐлòÖ¸¶¨¸ö×Ö·û
fprintf() °´¸ñʽÊä³öµ½Á÷
fscanf() ´ÓÁ÷Öа´¸ñʽ¶ÁÈ¡
feof() µ½´ïÎļþβʱ·µ»ØÕæÖµ
ferror() ·¢Éú´íÎóʱ·µ»ØÆäÖµ
rewind() ¸´Î»Îļþ¶¨Î»Æ÷µ½Îļþ¿ªÊ¼´¦
remove() ɾ³ýÎļþ
fread() ´ÓÁ÷ÖжÁÖ¸¶¨¸öÊýµÄ×Ö·û
fwrite() ÏòÁ÷ÖÐдָ¶¨¸öÊýµÄ×Ö·û
tmpfile() Éú³ÉÒ»¸öÁÙʱÎļþÁ÷
tmpnam() Éú³ÉÒ»¸öΨһµÄÎļþÃû
¡¡¡¡ÏÂÃæ¾Í½éÉÜÒ»ÏÂÕâЩº¯Êý
1.fopen()
¡¡¡¡fopenµÄÔ­ÐÍÊÇ£ºFILE *fopen(const char *filename,const char *mode)£¬fopenʵÏÖÈý¸ö¹¦ÄÜ
ΪʹÓöø´ò¿ªÒ»¸öÁ÷
°ÑÒ»¸öÎļþºÍ´ËÁ÷ÏàÁ¬½Ó
¸ø´ËÁ÷·µ»ØÒ»¸öFILRÖ¸Õë
²ÎÊýfilenameÖ¸ÏòÒª´ò¿ªµÄÎļþÃû£¬mode±íʾ´ò¿ª×´Ì¬µÄ×Ö·û´®£¬ÆäÈ¡ÖµÈçϱí
×Ö·û´® º¬Òå
"r" ÒÔÖ»¶Á·½Ê½´ò¿ªÎļþ
"w" ÒÔֻд·½Ê½´ò¿ªÎļþ
"a" ÒÔ×·¼Ó·½Ê½´ò¿ªÎļþ
"r+" ÒÔ¶Á/д·½Ê½´ò¿ªÎļþ£¬ÈçÎÞÎļþ³ö´í
"w+" ÒÔ¶Á/д·½Ê½´ò¿ªÎļþ£¬ÈçÎÞÎļþÉú³ÉÐÂÎļþ
¡¡¡¡Ò»¸öÎļþ¿ÉÒÔÒ


Ïà¹ØÎĵµ£º

C/C++ÎļþµÄ²Ù×÷£¨fread() fwrite()£©

freadº¯ÊýºÍfwriteº¯Êý
1.º¯Êý¹¦ÄÜ
  ÓÃÀ´¶Áдһ¸öÊý¾Ý¿é¡£
2.Ò»°ãµ÷ÓÃÐÎʽ
  fread(buffer,size,count,fp);
  fwrite(buffer,size,count,fp);
3.˵Ã÷
  £¨1£©buffer£ºÊÇÒ»¸öÖ¸Õ룬¶ÔfreadÀ´Ëµ£¬ËüÊǶÁÈëÊý¾ÝµÄ´æ·ÅµØÖ·¡£¶ÔfwriteÀ´Ëµ£¬ÊÇÒªÊä³öÊý¾ÝµÄµØÖ·¡£
  £¨2£©size£ºÒª¶ÁдµÄ×Ö½ÚÊý ......

[C/C++ Digestion] – ×Ôµ×ÏòÉϵØ̽¾¿Ð麯Êý


[C/C++ Digestion] –
×Ôµ×ÏòÉϵØ̽¾¿Ð麯Êý
×÷Õߣº
Jason Lee @
http://blog.csdn.net/jasonblog
ÈÕÆÚ£º
2010-05-19
»·¾³£º
Visual C++ Express
2008
ÉùÃ÷£º±¾ÎÄ·¢±íÔÚ
csdn
²©¿Í£¬ÈçÓÐתÔØ£¬Çë×¢Ã÷³ö´¦
 
[1]C++
¶ÔÏóÄ£ÐÍ»ù´¡
Ò»¸öÀàÖпÉÒÔ°üº¬¾²Ì¬Êý¾Ý³ÉÔ±¡¢¾²Ì¬³ÉÔ±º¯Êý¡¢·Ç¾²Ì¬³ÉÔ±º¯Êýº ......

c/c++Ö§³Ö¿É±ä²ÎÊýµÄº¯Êý

c/c++Ö§³Ö¿É±ä²ÎÊýµÄº¯Êý£¬¼´º¯ÊýµÄ²ÎÊýÊDz»È·¶¨µÄ¡£
Ò»¡¢ÎªÊ²Ã´ÒªÊ¹Óÿɱä²ÎÊýµÄº¯Êý£¿
Ò»°ãÎÒÃDZà³ÌµÄʱºò£¬º¯ÊýÖÐÐÎʽ²ÎÊýµÄÊýĿͨ³£ÊÇÈ·¶¨µÄ£¬ÔÚµ÷ÓÃʱҪÒÀ´Î¸ø³öÓëÐÎʽ²ÎÊý¶ÔÓ¦µÄËùÓÐʵ¼Ê²ÎÊý¡£µ«ÔÚijЩÇé¿öÏÂÏ£Íûº¯ÊýµÄ²ÎÊý¸öÊý¿ÉÒÔ¸ù¾ÝÐèҪȷ¶¨£¬Òò´ËcÓïÑÔÒýÈë¿É±ä²ÎÊýº¯Êý¡£ÕâÒ²ÊÇc¹¦ÄÜÇ¿´óµÄÒ»¸ö·½Ã棬ÆäËüÄ³Ð©Ó ......

ʹÓÃPTDD ½â¾ö¶à¸ö·ÖÇøGHOSTºó±äÒ»¸öCÅÌ·ÖÇø½â¾ö°ì·¨


¡¡¡¡Óû§Ê¹ÓÃGhostÖØװϵͳ£¬¾­³£³öÏÖ C D E F ...¶à¸ö·ÖÇø ±ä³ÉÒ»¸ö C·ÖÇø£¬Ôì³ÉÊý¾Ý¶ªÊ§£¬Õâʱ¾ÍÐèÒªÊý¾Ý»Ö¸´¹¤×÷¡£
¡¡¡¡ËäÈ»Õû¸öÓ²Å̱ä³ÉÁËÒ»¸ö·ÖÇø£¬µ«Í¨¹ýÊý¾Ý»Ö¸´¼¼Êõ¿ÉÒÔÊdzýÔ­À´µÄC·ÖÇøÍ⣬ÆäËü´ÅÅÌ·ÖÇøµÄÊý¾Ý¶¼Äܱ»»Ö¸´¡£
     ÏÂÃæÎÒÃÇÀ´¿´ÈçºÎÀ´»Ö¸´£º
     ÕâÀïÎ ......

ÓÃEclipse CDT ÅäÖà C/C++ ±àÒë»·¾³

1¡¢Java JDKµÄ°²×°
EclipseÊÇÒ»¿î¿çƽ̨µÄ¹¤¾ß£¬Ö»ÐèÒª»ù±¾µÄjavaÐéÄâ»ú¾Í¿ÉÒÔÔËÐС£
°²×°Java
SDKºÜ¼òµ¥¡£µ½http://java.sun.comÉÏÕÒµ½ÊʺÏÄãµÄ²Ù×÷ϵͳµÄJava
JDK°²×°³ÌÐò£¬ÏÂÔØÖ®²¢ÔËÐУ¬Java SDK¾Í»á°²×°µ½ÄãµÄϵͳÖС£
×¢Ò⣬¸ü¸ß°æ±¾µÄEclipseÐèÒª¸ü¸ß°æ±¾µÄJava JDK¡£
2¡¢Eclipse¼°CDTµÄ°²×°
µ½EclipseµÄ¹Ù·½ ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ