Views 28524 Votes 0 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
텍스트 한줄 읽기
char buffer[125], *ps;
CString strName, strNum;
CString readfilename = pDlg.GetPathName();
m_readfile = readfilename;

FILE *stream = fopen(m_readfile, "rt");
if (stream == NULL) return;

while (fgets(buffer, 125, stream) != NULL) // 텍스트파일을 한줄씩 읽습니다. 
{
    ps = strchr(buffer, '\n'); // 제일 뒤쪽의 new line의 char을 찿아.
    if (ps != NULL) *ps = '\0';// new line의 char을 null문자로 바꿉니다. 

    int cn = 0;
    ps = strtok(buffer, ",");
    while (ps) {
        if (cn == 0) strName.Format("%s", ps);
        else strNum.Format("%s", ps);
        ps = strtok(NULL, ",");
        cn++;
    }
    TRACE("%s\r\n",buffer);
}

바이너리 파일 읽기
FILE *rfp,*wfp;
int c;

if((rfp = fopen(rpath,"rb"))==NULL)
    return;

if((wfp = fopen(wpath,"ab"))==NULL)
{
    fclose(rfp);
    return;
}

while(1)
{
    c = fgetc(rfp);
    if(!feof(rfp))
    {
        int a = ftell(wfp);
        fputc(c,wfp);
    }
    else
        reak;
}
fclose(rfp);
fclose(wfp);

MFC 파일 한줄씩 읽기
CStdioFile file(fileName, CFile::modeRead | CFile::typeText);

while(1)
{
    if ( !file.ReadString(str) )
        break;
}
file.Close();
return true;

?

  1. 엑셀 함수 총 정리 ㅎㅎ

    Date2013.06.05 CategoryEtc Byhooni Views24464
    Read More
  2. [c++] MD5 구현 소스.. 퍼움..

    Date2013.04.23 CategoryDevelop Byhooni Views24070
    Read More
  3. [ios] 아이폰 개발 총정리..

    Date2013.04.23 CategoryDevelop Byhooni Views23863
    Read More
  4. [pdf] GPS의 동작 원리 ㅎㅎ

    Date2013.04.23 CategoryDevelop Byhooni Views23834
    Read More
  5. [linux] 리눅스, 유닉스 CPU 이용률 확인..

    Date2013.04.23 CategorySystem/OS Byhooni Views23782
    Read More
  6. [c] 다중연결 서버 만들기 #4 - thread 사용

    Date2013.04.23 CategoryDevelop Byhooni Views23702
    Read More
  7. [c#] 비동기 통신 샘플 코드 ㅎㅎ

    Date2013.04.23 CategoryDevelop Byhooni Views23635
    Read More
  8. [ppt] 뚜레쥬르 온라인 마케팅 제안서

    Date2013.04.23 CategoryPPT Byhooni Views23494
    Read More
  9. [ios] 아이폰 개발 따라하기 ㅋㅋㅋ

    Date2013.04.23 CategoryEtc Byhooni Views23302
    Read More
  10. GCM 사용하기 2 (단말에 GCM 구현하기)

    Date2013.07.06 CategoryDevelop Byhooni Views23248
    Read More
  11. [ios] UIColor 지정에서 RGB define ㅎㅎ

    Date2013.04.23 CategoryDevelop Byhooni Views22914
    Read More
  12. 러시아 페인트공 알고리즘에 대해..

    Date2013.04.23 CategoryAlgorithm Byhooni Views22895
    Read More
  13. [js] 자바스크립트(Javascript) 코드를 동적으로 삽입하는 방법..

    Date2013.04.23 CategoryDevelop Byhooni Views22877
    Read More
  14. [ios] UILabel top alignㅎㅎ

    Date2013.04.23 CategoryDevelop Byhooni Views22840
    Read More
  15. 밸런싱 로봇.. 최종.. (관련 논문도 첨부) ㅋㅋ

    Date2013.04.23 CategoryDevelop Byhooni Views22820
    Read More
  16. [doc] 정보보호이론 강의자료 (중앙대꺼..)

    Date2013.04.23 CategoryPPT Byhooni Views22811
    Read More
Board Pagination Prev 1 ... 7 8 9 10 11 ... 74 Next
/ 74