T
tonyjeffs
#include "stdafx.h"
#include "stdafx.h"
#include<iostream>
#include <fstream>
using namespace std;
using std::cout;
int main(int argc, char* argv[])
{
ifstream infile ("b.bmp");
for (int n=0; n<200;n++)
{
int c= infile.get();
if ((n>145)&&(n<165))//print the interesting bit
cout<<c<<" ";
}
return 0;
}
I thought the output would be
23 23 23 0 24 24 24 0 25 25 25 0 26 26 26 0 27 27 27
but it is
23 23 23 0 24 24 24 0 25 25 25 0 -1 -1 -1 -1 -1 -1 -1
b.bmp is a 2k file
from n
Why won't infile.get() work beyond the 157th place?
Thanx
Tony
#include "stdafx.h"
#include<iostream>
#include <fstream>
using namespace std;
using std::cout;
int main(int argc, char* argv[])
{
ifstream infile ("b.bmp");
for (int n=0; n<200;n++)
{
int c= infile.get();
if ((n>145)&&(n<165))//print the interesting bit
cout<<c<<" ";
}
return 0;
}
I thought the output would be
23 23 23 0 24 24 24 0 25 25 25 0 26 26 26 0 27 27 27
but it is
23 23 23 0 24 24 24 0 25 25 25 0 -1 -1 -1 -1 -1 -1 -1
b.bmp is a 2k file
from n
Why won't infile.get() work beyond the 157th place?
Thanx
Tony