CÓïÑÔÎļþÏà¹Ø²Ù×÷
CÓïÑÔÎļþ²Ù×÷½Ó´¥ºÜ¾ÃÁË£¬Ò»Ö±Ã»ÓÐ×ܽáÏà¹ØÄÚÈÝ£¬½ñÌìÓõ½Á˾ÍÈ¥ÕÒÁËÕÒÏà¹ØÄÚÈÝ¡£
ÔÚANSI CÖУ¬¶ÔÎļþµÄ²Ù×÷·ÖΪÁ½ÖÖ·½Ê½£¬¼´Á÷ʽÎļþ²Ù×÷ºÍI/OÎļþ²Ù×÷
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 */
VCÖÐFILEµÄ¶¨ÒåΪ
struct _iobuf {
char *_ptr; //ÎļþÊäÈëµÄÏÂÒ»¸öλÖÃ
int _cnt; //µ±Ç°»º³åÇøµÄÏà¶ÔλÖÃ
char *_base; //Ö¸»ù´¡Î»ÖÃ(¼´ÊÇÎļþµÄÆäʼλÖÃ)
int _flag; //Îļþ±êÖ¾
int _file; //ÎļþµÄÓÐЧÐÔÑéÖ¤
int _charbuf; //¼ì²é»º³åÇø×´¿ö,Èç¹ûÎÞ»º³åÇøÔò²»¶ÁÈ¡
int _bufsiz; //ÎļþµÄ´óС
char *_tmpfname; //ÁÙʱÎļþÃû
};
typedef struct _iobuf FILE;
FILEÕâ¸ö½á¹¹°üº¬ÁËÎļþ²Ù×÷µÄ»ù±¾ÊôÐÔ£¬¶ÔÎļþµÄ²Ù×÷¶¼ÒªÍ¨¹ýÕâ¸ö½á¹¹µÄÖ¸ÕëÀ´½øÐС£
Îļþ´ò¿ªº¯Êýfopen
¡¡¡¡fopenº¯ÊýÓÃÀ´´ò¿ªÒ»¸öÎļþ£¬Æäµ÷ÓõÄÒ»°ãÐÎʽΪ£º
ÎļþÖ¸ÕëÃû=fopen(ÎļþÃû£¬Ê¹ÓÃÎļþ·½Ê½) ÆäÖУ¬“ÎļþÖ¸ÕëÃû”±ØÐëÊDZ»ËµÃ÷ΪFILE ÀàÐ͵ÄÖ¸Õë±äÁ¿£¬“ÎļþÃû”ÊDZ»´ò¿ªÎļþµÄÎļþÃû¡£
“ʹÓÃÎļþ·½Ê½”ÊÇÖ¸ÎļþµÄÀàÐͺͲÙ×÷ÒªÇ󡣓ÎļþÃû”ÊÇ×Ö·û´®³£Á¿»ò×Ö·û´®Êý×é¡£ÀýÈ磺
FILE *fp£»
fp=("file a","r");
ÆäÒâÒåÊÇÔÚµ±Ç°Ä¿Â¼Ï´ò¿ªÎļþfile a£¬ Ö»ÔÊÐí½øÐГ¶Á”²Ù×÷£¬²¢Ê¹fpÖ¸Ïò¸ÃÎļþ¡£
ÓÖÈ磺
FILE *fphzk
fphzk=("c:\hzk16',"rb")
ÆäÒâÒåÊÇ´ò¿ªCÇý¶¯Æ÷´ÅÅ̵ĸùĿ¼ÏµÄÎļþhzk16£¬ ÕâÊÇÒ»¸ö¶þ½øÖÆÎļþ£¬Ö»ÔÊÐí°´¶þ½øÖÆ·½Ê½½øÐжÁ²Ù×÷¡£Á½¸ö·´Ð±Ïß“\ ”ÖеĵÚÒ»¸ö±íʾתÒå×Ö·û£¬µÚ¶þ¸ö±íʾ¸ùĿ¼¡£Ê¹ÓÃÎļþµÄ·½Ê½¹²ÓÐ12ÖÖ£¬ÏÂÃæ¸ø³öÁËËüÃǵķûºÅºÍÒâÒå¡£
ÎļþʹÓ÷½Ê½ ¡¡¡¡¡¡¡¡¡¡¡¡¡¡Òâ Òå
“rt”¡¡¡¡¡¡¡¡¡¡¡¡Ö»¶Á´ò¿ªÒ»¸öÎı¾Îļþ£¬Ö»ÔÊÐí¶ÁÊý¾Ý
“wt&r
Ïà¹ØÎĵµ£º
±¾ÎÄ´Ó½éÉÜ»ù´¡¸ÅÄîÈëÊÖ£¬Ì½ÌÖÁËÔÚC/C++ÖжÔÈÕÆÚºÍʱ¼ä²Ù×÷ËùÓõ½µÄÊý¾Ý½á¹¹ºÍº¯Êý£¬²¢¶Ô¼Æʱ¡¢Ê±¼äµÄ»ñÈ¡¡¢Ê±¼äµÄ¼ÆËãºÍÏÔʾ¸ñʽµÈ·½Ãæ½øÐÐÁ˲ûÊö¡£±¾ÎÄ»¹Í¨¹ý´óÁ¿µÄʵÀýÏòÄãչʾÁËtime.hÍ·ÎļþÖÐÉùÃ÷µÄ¸÷ÖÖº¯ÊýºÍÊý¾Ý½á¹¹µÄÏêϸʹÓ÷½·¨¡£
¹Ø¼ü×Ö£ºUTC£¨ÊÀ½ç±ê׼ʱ¼ä£©£¬Calendar Time£¨ÈÕÀúʱ¼ä£©£¬epoch£¨Ê±¼äµã£©£¬cl ......
11¡¢ÏÂÃæµÄ´úÂëÊä³öÊÇʲô£¬ÎªÊ²Ã´£¿
Void foo(void)
{
unsigned int a = 6;
int b = -20;
(a+b > 6) £¿puts("> 6") : puts("<= 6");
}
²»¹ÜÈçºÎ£¬ÕâÎÞ·ûºÅÕûÐÍÎÊÌâµÄ´ð°¸ÊÇÊä³öÊÇ“>6”¡£ÔÒòÊǵ±±í´ïʽÖдæÔÚÓзûºÅÀàÐͺÍÎÞ·ûºÅÀàÐÍʱËùÓеIJÙ×÷Êý¶¼×Ô¶¯×ª»»ÎªÎÞ·ûºÅÀàÐÍ¡£Òò´Ë-20±ä³ÉÁËÒ»¸ ......
±¾³ÌÐò¿ÉÒÔ¶ÁÈ¡.wavÎļþ£¬È»ºó½øÐв¥·Å¡£
È·ÈÏ·½·¨£ºcat /etc/sndstat£¬Èç¹ûÏÔʾÎÞ´ËÉ豸£¬ÔòûÓа²×°Çý¶¯¡£
#include <unistd.h>#include <fcntl.h>#include <sys/types.h>#include <sys/ioctl.h>#include <stdlib.h>#include <stdio.h>#include&nbs ......
http://www.kuqin.com/language/20090314/39862.html
Ö¸ÕëÊÇÒ»¸öÌØÊâµÄ±äÁ¿£¬ËüÀïÃæ´æ´¢µÄÊýÖµ±»½âÊͳÉΪÄÚ´æÀïµÄÒ»¸öµØÖ·¡£ Òª¸ãÇåÒ»¸öÖ¸ÕëÐèÒª¸ãÇåÖ¸ÕëµÄËÄ·½ÃæµÄÄÚÈÝ£ºÖ¸ÕëµÄÀàÐÍ£¬Ö¸ÕëËùÖ¸ÏòµÄ ÀàÐÍ£¬Ö¸ÕëµÄÖµ»òÕß½ÐÖ¸ÕëËùÖ¸ÏòµÄÄÚ´æÇø£¬»¹ÓÐÖ¸Õë±¾ÉíËùÕ¼¾ÝµÄÄÚ´æÇø¡£ÈÃÎÒÃÇ·Ö±ð˵Ã÷¡£
¡¡¡¡ ÏÈÉùÃ÷¼¸¸öÖ¸Õë·Å×Å×öÀý× ......