Computer Vision

fprintf() 테스트

maetel 2010. 7. 6. 23:51
테스트: 아웃풋 수치 데이터를 파일로 기록하기

http://cplusplus.com/reference/clibrary/cstdio/fprintf/


#include <iostream>

int main (int argc, char * const argv[]) {

#include <iostream>
   
    FILE *fileI, *fileW;
    fileI = fopen( "image2d.txt", "w" );
    fileW = fopen( "world2d.txt", "w" );
   
    double ix = 1.1;
    double iy = 1.2;
   
    double wx = 2.1;
    double wy = 2.2;
   
   
    fprintf( fileI, "%lf\t%lf\n", ix, iy);
    fprintf( fileW, "%lf\t%lf\n", wx, wy);
   
   
    fclose( fileI );
    fclose( fileW );
   
    return 0;
       
}