I'm trying to read in a picture file.
#include <iostream>
#include <fstream>
using namespace std;
int main()
{
ifstream read("C://Users/Ben/Desktop/1.jpg");
while (1){
cout << read.get();
cin.get();
}
return 0;
}
When I do this, I get a series of numbers ranging from 0 ~ 255. So I'm assuming it's reading in the byte values correctly, except for the fact that I hit -1 (eof) prematurely. After about 30 to 40 values, the -1 appears. It's a 3MB file. I don't expect the -1 to appear until way later. What's going on?