- Timestamp:
- 07/16/12 17:45:10 (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
fact/tools/pyscripts/sandbox/dneise/fact_compress/c++/compare.cpp
r14229 r14268 3 3 #include <iostream> 4 4 #include <fstream> 5 #include <stdint.h> 6 #include <stdio.h> 5 7 using namespace std; 6 8 … … 10 12 char c1,c2; 11 13 12 int main ( ) {14 int main (int argc, char * argv[]) { 13 15 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); 16 18 17 19 if (in1.is_open() && in2.is_open()) … … 22 24 end = in1.tellg(); 23 25 in1.seekg (0, ios::beg); 24 cout << "a.fitssize:" << end-begin << endl;26 cout << argv[1] <<" size:" << end-begin << endl; 25 27 26 28 begin = in2.tellg(); … … 28 30 end = in2.tellg(); 29 31 in2.seekg (0, ios::beg); 30 cout << "bla.binsize:" << end-begin << endl;32 cout << argv[2] <<" size:" << end-begin << endl; 31 33 32 34 while ( in1.good() && in2.good() ) … … 37 39 { 38 40 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; 41 44 } 42 45 }
Note:
See TracChangeset
for help on using the changeset viewer.