메뉴 건너뛰기

app

file에 기록하고 열람하는 source

박영식2003.11.05 19:53조회 수 2371댓글 0

    • 글자 크기
bool CRandom::fileLoad()
{
FILE *fp;
  int i;

  printf("읽을 파일 명은 num.txt입니다.n");
fp = fopen("num.txt", "rt"); //임의 파일명 입력.
for(i=1;i<100;i++)
{
        fscanf(fp,"%d ",&mat[i]);
        printf("%dt",mat[i]);
}
return true;
}

void CRandom::saveResult(int index, char check)
{
FILE *filep;
filep = fopen("log.txt", "a");
if (check=='l')
        fprintf(filep,"nlinear search 결과 = %d, 속도 = %d",index,index);
else if(check=='b')
         fprintf(filep,"nbinary search 결과 = %d, 속도 = %d",index,cnt);
else if(check=='i')
         fprintf(filep,"ninterpolation search 결과 = %d, 속도 = %d",index,cnt);

fclose(filep);
}
박영식 (비회원)
    • 글자 크기
bubble과 selection sort (by 박영식) linearSearch & lsmf (by 박영식)

댓글 달기

박영식
2006.06.18 조회 2524
박영식
2005.03.25 조회 2253
박영식
2003.12.25 조회 4050
박영식
2003.12.19 조회 3610
박영식
2003.11.05 조회 17690
박영식
2003.11.05 조회 2418
박영식
2003.11.05 조회 2627
박영식
2003.11.05 조회 2324
박영식
2003.11.05 조회 2363
박영식
2003.11.05 조회 3387
박영식
2002.06.14 조회 2732
박영식
2002.04.18 조회 3538
박영식
2002.04.18 조회 3435
첨부 (0)
위로