why the buffer cannot be printed correctly to cout?
The example you gave outs the imge in file in the proper way but it does not print the buffer to the default stdout correctly.
I want to use this problem as cgi binary and the goal is the image to be printed in the browser. Now in the browser I got a broken image and the out.bmp file is OK.
User Profile
Collapse
-
problem reading and outputting binarry file
Hi
I have a problem with the following code.
#include <iostream>
#include <fstream>
using namespace std;
int main(int argc, char *argv[])
{
int i;
int me;
char * Buffer;
ifstream inFile (argv[1], ios::binary );
if (!inFile) {
cerr << "Unable to open image file";
exit(1);
}...
No activity results to display
Show More
Leave a comment: