Contents

Views 13529 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
333 Develop [c] 암호 알고리즘 소스.. file hooni 2013.04.23 8342
332 Develop [c] 시스템 보안 과제.. 시간(amc time) 변경 file hooni 2013.04.23 7194
331 Develop [switch] 시스코 카탈리스트(Cisco Catalyst) 2950 미러링 설정 hooni 2013.04.23 11392
330 System/OS [switch] 시스코 카탈리스트(Cisco Catalyst) 기본 설정 hooni 2013.04.23 17497
329 System/OS [switch] 시스코 스위치 관리자 암호 초기화 방법 hooni 2013.04.23 17188
328 System/OS [windows] 원격 데스크탑(터미널 서비스) 포트 변경 hooni 2013.04.23 16305
327 Develop [c] 네트워크 보안 프로그래밍 과제 (Server,Agent,Client) file hooni 2013.04.23 6473
326 Develop [php] 탐색기와 같은 다이나믹 트리(xml/xsl 이용) file hooni 2013.04.23 7154
325 Develop [js] 스타크래프트(starcraft).. file hooni 2013.04.23 6641
324 Develop [js] 툴팁.. 좋은거.. (tooltip) file hooni 2013.04.23 7059
323 PPT [ppt] Magic URLs & Hidden Form Fields 에 대해.. ㅋㅋ file hooni 2013.04.23 12094
322 Develop [web] URL 인코딩 방법.. 테이블.. ㅋㅋ hooni 2013.04.23 7143
Board Pagination Prev 1 ... 66 67 68 69 70 71 72 73 74 75 ... 98 Next
/ 98