Ignore:
Timestamp:
07/16/12 17:45:10 (12 years ago)
Author:
neise
Message:
evolving
File:
1 edited

Legend:

Unmodified
Added
Removed
  • fact/tools/pyscripts/sandbox/dneise/fact_compress/c++/compare.cpp

    r14229 r14268  
    33#include <iostream>
    44#include <fstream>
     5#include <stdint.h>
     6#include <stdio.h>
    57using namespace std;
    68
     
    1012char c1,c2;
    1113
    12 int main () {
     14int main (int argc, char * argv[]) {
    1315   
    14     ifstream in1 ("a.fits", ios::in|ios::binary);
    15     ifstream in2 ("bla.bin", ios::in|ios::binary);
     16    ifstream in1 ( argv[1], ios::in|ios::binary);
     17    ifstream in2 ( argv[2], ios::in|ios::binary);
    1618   
    1719    if (in1.is_open() && in2.is_open())
     
    2224        end = in1.tellg();
    2325        in1.seekg (0, ios::beg);
    24         cout << "a.fits size:" << end-begin << endl;
     26        cout << argv[1] <<" size:" << end-begin << endl;
    2527       
    2628        begin = in2.tellg();
     
    2830        end = in2.tellg();
    2931        in2.seekg (0, ios::beg);
    30         cout << "bla.bin size:" << end-begin << endl;
     32        cout << argv[2] <<" size:" << end-begin << endl;
    3133       
    3234        while ( in1.good() && in2.good() )
     
    3739            {
    3840                cout << "difference found @ adress:" << hex << in1.tellg() << "\t" << in2.tellg() << endl;
    39                 cout << "in1:" << hex << int(c1) << endl;
    40                 cout << "in2:" << hex << int(c2) << endl;
     41                printf ("%30s \t: 0x%X \n", argv[1] ,uint8_t(c1) );
     42                printf ("%30s \t: 0x%X \n", argv[2] ,uint8_t(c2) );
     43                break;
    4144            }
    4245        }
Note: See TracChangeset for help on using the changeset viewer.