Contents

Views 13523 Comment 0
?

Shortcut

PrevPrev Article

NextNext Article

Larger Font Smaller Font Up Down Go comment Print
?

Shortcut

PrevPrev Article

NextNext Article

Larger Font Smaller Font Up Down Go comment Print
데이터 쓰기
: 배열 1~100 까지 내용을 저장하고 그 값을 파일(FILE.DAT)로 출력함
void CFileExView::OnFilesave() 
{
    int buffer[100];
    for ( int i=0 ; i<100 ; i++ )
        buffer[i] = i+1;

    CFile file;
    file.Open(_T("FILE.DAT"), CFile::modeCreate | CFile::modeWrite);
    file.Write(buffer, 100 * sizeof(int));
    file.Close(); 
}

데이터 읽기
: FILE.DAT 에서 데이터를 읽어와서 배열에 값을 저장하고 메시지 박스에 값을 출력함
void CFileExView::OnFileload() 
{
    int buffer[100];
    CString str, tmp;

    CFile file;
    file.Open(_T("FILE.DAT"), CFile::modeRead);
    file.Read(buffer, 100 * sizeof(int));
    file.Close();

    for ( int i=0 ; i<100 ; i++ )
    {
        tmp.Format("%d", buffer[i]);
        str += tmp + " ";
    }

    AfxMessageBox(str); 
}


?

List of Articles
No. Category Subject Author Date Views
729 PPT [doc] 정보보호이론 강의자료 (중앙대꺼..) 2 file hooni 2013.04.23 22811
728 PPT [doc] 정보보호학술대회 논문지 ㅋㅋ file hooni 2013.04.23 12178
727 System/OS [doc] 코코아 프로그래밍 for MACOS 관련 내 분량.. file hooni 2013.04.23 20839
726 Develop [doc] 테크니컬 레포트 (BHO 취약점을 이용한 공격) 2 file hooni 2013.04.23 27074
725 System/OS [doc] 피쳐셀렉션(feature selection using..) 발표 자료 file hooni 2013.04.23 12546
724 System/OS [dos] 노트북 백업 스크립트 xcopy 명령 예제 hooni 2003.04.23 40805
723 Etc [english] 영어공부 혼자 하기, 인터넷으로 영어공부하기 추천사이트 20선 file hooni 2013.11.25 9408
722 Etc [eng] 숙제 ㅋㅋㅋ secret hooni 2015.10.14 1
721 Develop [erp] SAP 모듈 요약 hooni 2013.04.23 15281
720 Etc [flash] 맘에 드는 파이차트 file hooni 2013.04.23 12590
719 Etc [flash] 자동차 엔진의 원리 (4행정 사이클 그림) file hooni 2013.04.23 21224
718 Etc [flash] 페이지 이동 (액션스크립트) file hooni 2013.04.23 16263
Board Pagination Prev 1 ... 33 34 35 36 37 38 39 40 41 42 ... 98 Next
/ 98