c±ê×¼¿âº¯Êý
±¾ÎÄ°üÀ¨´ó²¿·ÖC±ê×¼¿âº¯Êý£¬µ«Ã»ÓÐÁгöһЩÓÃ;ÓÐÏ޵ĺ¯ÊýÒÔ¼°Ä³Ð©¿ÉÒÔ¼òµ¥µÄ´ÓÆäËûº¯ÊýºÏ³ÉµÄº¯Êý£¬Ò²Ã»Óаüº¬¶à×ֽںͱ¾µØ»¯º¯Êý¡£
±ê×¼¿âÖеĸ÷¸öº¯Êý¡¢ÀàÐÍÒÔ¼°ºê·Ö±ðÔÚÒÔϱê׼ͷÎļþÖÐ˵Ã÷£º
<assert.h> <float.h> <math.h> <stdarg.h> <stdlib.h>
<ctype.h> <limits.h> <setjmp.h> <stddef.h> <string.h>
<errno.h> <locale.h> <signal.h> <stdio.h> <time.h>
1 ÊäÈëÓëÊä³ö<stdio.h>
Í·Îļþ<stdio.h>¶¨ÒåÁËÓÃÓÚÊäÈëºÍÊä³öµÄº¯Êý¡¢ÀàÐͺͺꡣ×îÖØÒªµÄÀàÐÍÊÇÓÃÓÚÉùÃ÷ÎļþÖ¸ÕëµÄFILE¡£ÁíÍâÁ½¸ö³£ÓõÄÀàÐÍÊÇsize_tºÍfpos_t£¬size_tÊÇÓÉÔËËã·ûsizeof²úÉúµÄÎÞ·ûºÅÕûÀàÐÍ£»fpos_tÀàÐͶ¨ÒåÄܹ»Î¨Ò»ËµÃ÷ÎļþÖеÄÿ¸öλÖõĶÔÏó¡£ÓÉÍ·²¿¶¨ÒåµÄ×îÓÐÓõĺêÊÇEOF£¬ÆäÖµ´ú±íÎļþµÄ½áβ¡£
1.1 Îļþ²Ù×÷
1.1.1 fopen
#include <stdio.h>
FILE *fopen(const char *filename, const char *mode);
·µ»Ø£º³É¹¦ÎªFILEÖ¸Õ룬ʧ°ÜΪNULL
´ò¿ªÒÔfilenameËùÖ¸ÄÚÈÝΪÃû×ÖµÄÎļþ£¬·µ»ØÓëÖ®¹ØÁªµÄÁ÷¡£
mode¾ö¶¨´ò¿ªµÄ·½Ê½£¬¿ÉÑ¡ÖµÈçÏ£º
"r" ´ò¿ªÎı¾ÎļþÓÃÓÚ¶Á
"w" ´´½¨Îı¾ÎļþÓÃÓÚд£¬²¢É¾³ýÒÑ´æÔÚµÄÄÚÈÝ(Èç¹ûÓеĻ°)
"a" Ìí¼Ó£»´ò¿ª»ò´´½¨Îı¾ÎļþÓÃÓÚÔÚÎļþĩβд
"rb" ´ò¿ª¶þ½øÖÆÎļþÓÃÓÚ¶Á
"wb" ´´½¨¶þ½øÖÆÎļþÓÃÓÚд£¬²¢É¾³ýÒÑ´æÔÚµÄÄÚÈÝ(Èç¹ûÓеĻ°)
"ab" Ìí¼Ó£»´ò¿ª»ò´´½¨¶þ½øÖÆÎļþÓÃÓÚÔÚÎļþĩβд
"r+" ´ò¿ªÎı¾ÎļþÓÃÓÚ¸üÐÂ(¼´¶ÁºÍд)
"w+" ´´½¨Îı¾ÎļþÓÃÓÚ¸üУ¬²¢É¾³ýÒÑ´æÔÚµÄÄÚÈÝ(Èç¹ûÓеĻ°)
"a+" Ìí¼Ó£»´ò¿ª»ò´´½¨Îı¾ÎļþÓÃÓÚ¸üкÍÔÚÎļþĩβд
"rb+"»ò"r+b" ´ò¿ª¶þ½øÖÆÎļþÓÃÓÚ¸üÐÂ(¼´¶ÁºÍд)
"wb+"»ò"w+b" ´´½¨¶þ½øÖÆÎļþÓÃÓÚ¸üУ¬²¢É¾³ýÒÑ´æÔÚµÄÄÚÈÝ(Èç¹ûÓеĻ°)
"ab+"»ò"a+b" Ìí¼Ó£»´ò¿ª»ò´´½¨¶þ½øÖÆÎļþÓÃÓÚ¸üкÍÔÚÎļþĩβд
ºóÁùÖÖ·½Ê½ÔÊÐí¶ÔͬһÎļþ½øÐжÁºÍд£¬Òª×¢ÒâµÄÊÇ£¬ÔÚд²Ù×÷ºÍ¶Á²Ù×÷µÄ½»Ìæ¹ý³ÌÖУ¬±ØÐëµ÷ÓÃfflush()»òÎļþ¶¨Î»º¯ÊýÈçfseek()¡¢fsetpos()¡¢rewind()µÈ¡£
ÎļþÃûfilenameµÄ³¤¶È×î´óΪFILENAME_MAX¸ö×Ö·û£¬Ò»´Î×î¶à¿É´ò¿ªFOPEN_MAX¸öÎļþ(ÔÚ<stdio.h>Öж¨Òå)¡£
1.1.2 freopen
#include <stdio.h>
FILE *freopen(const char *filename, const char *mode, FILE *stream);
·µ»Ø£º³É¹¦Îªstream£¬Ê§°ÜΪNULL
ÒÔmodeÖ¸¶¨µÄ·½Ê½
Ïà¹ØÎĵµ£º
CÓïÑÔ±ØÖª±Ø»á£¨2£©
4.º¯ÊýºÍÖ¸Õë
4.1. Ö¸Ïòº¯ÊýµÄÖ¸Õë
Ö¸Ïòº¯ÊýµÄÖ¸Õ뼴ͨ³£ËµµÄº¯ÊýÖ¸Õ룬ÕýÊÇÓÉÓÚÕâЩ¼ò³Æ£¬ËùÒÔËüºÍ·µ»ØÖ¸ÕëµÄº¯Êý£¨Ö¸Õ뺯Êý£©ÈÝÒ×»ìÏý£¬¶øÇÒÒ²ÓÉÓÚд·¨ÉϱȽÏÏà½ü£¬¾ÍÏñÊý×éÖ¸Õë(int (*p)[4])ºÍÖ¸ÕëÊý×é(int *p[4])Ò»Ñù£¬Ç°Õß±íʾָÕë±äÁ¿pÖ¸ÏòÒ»¸öһάÊý×飬Õâ¸öÊý×éº¬Ó ......
Ç°¶Îʱ¼ä¸Õ²Î¼ÓÁËn¶à¹«Ë¾µÄC/C++Èí¼þ¹¤³ÌʦµÄÃæÊÔ£¬ÓйúÆó£¬ÍâÆó£¬Ë½Æó£¨moto£¬·É˼¿¨¶û£¬¸ÛÍ壬ÖйúÎÀÐÇXXX£¨Õâ¸öÅ££©£©µÈµÈµÈµÈ¡£¸ÐÊܸÐÏëÆĶ࣬½üÈÕÖÕÓÚ¿ÕÏУ¬Ôڴ˱íÊöһϡ£
±¾ÈË»ù±¾Ìõ¼þ£º3Ä꿪·¢¾Ñ飬2year+ Windows development experence£¬1year+ Linux experence. ÊìϤC£¬C++£¬MFC/SDK/API,MiniG ......
ÃæÊÔʱ±»Îʵ½¹ý£¬²»ÉõÃ÷ÁË£¬ÍøÉÏ°Ù¶Èһϣ¬ÕûºÏÁËÁ½¸öÈÊÐÖµÄÎÄÕ£¬ÈçÏ¡£:-)
ʱ³£ÔÚcppµÄ´úÂëÖ®Öп´µ½ÕâÑùµÄ´úÂë:
#ifdef __cplusplus //c++±àÒë»·¾³ÖвŻᶨÒå__cplusplus (plus¾ÍÊÇ"+"µÄÒâ˼)
extern "C" { //¸æËß±àÒëÆ÷ÏÂÃæµÄº¯ÊýÊÇcÓïÑÔº¯Êý£¨ÒòΪc++ºÍcÓïÑÔ¶Ôº¯ÊýµÄ±àÒëת»»²»Ò»Ñù£¬Ö÷ÒªÊÇc++ÖдæÔÚÖØÔØ£©
#en ......
// backlightDlg.cpp : implementation file
//
#include "stdafx.h"
#include "backlight.h"
#include "backlightDlg.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#endif
// CbacklightDlg dialog
CbacklightDlg::CbacklightDlg(CWnd* pParent /*=NULL*/)
: CDialog(CbacklightDlg::IDD, pParent)
{
......
©À—WINDOWS
©¦ ©À—system32£¨´æ·ÅWindowsµÄϵͳÎļþºÍÓ²¼þÇý¶¯³ÌÐò£©
©¦ ©¦ ©À—config£¨Óû§ÅäÖÃÐÅÏ¢ºÍÃÜÂëÐÅÏ¢£©
©¦ ©¦ ©¦ ©¸—systemprofile£¨ÏµÍ³ÅäÖÃÐÅÏ¢£¬ÓÃÓÚ»Ö¸´ÏµÍ³£©
©¦ ©¦ ©À—drivers£¨ÓÃÀ´´æ·ÅÓ²¼þÇý¶¯Îļþ£¬²»½¨Òéɾ³ý£©
©¦ ©¦ ©À—spool£¨ÓÃÀ´´æ·Åϵͳ´òÓ¡Îļþ¡£ ......