1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53
| #include<iostream>
#include<fstream>
using namespace std;
const int MAX_SIZE = 64;
int aRef[MAX_SIZE][MAX_SIZE]={0};
int cRowRef = 0, cColRef = 0;
int cRowApp = 0, cColApp = 0;
int LoadImg(???, int , int , int);
int PrintImg(int, int, int);
int main()
{
ifstream inputFile;
inputFile.open("ref.img");
LoadImg("ref.img", aRef, cRowRef, cColRef);
PrintImg(aRef, cRowRef, cColRef);
inputFile.close();
return 0 ;
}
LoadImg("ref.img", aRef, cRowRef, cColRef) // f2
{
cout<<"The image is: ";
for (cRowRef = 0; cRowRef<MAX_SIZE; cRowRef++)
{ cColRef=0;
//for(int cColRef= 0; cColRef<MAX_SIZE;)
while(inputFile>>aRef[cRowRef][cColRef])
cColRef++;
return aRef[cRowRef][cColRef];
}
}
PrintImg(aRef, cRowRef, cColRef)
{ for (int x = 0; x<cRowRef; x++)
{ for(int y= 0; y<cColRef; y++)
cout<<aRef[x][y];
}
}
} |
Partager