This code Reads in a binary file, counts up the number of binary 1s,2s,3s,4s.....255s and displays them on screen, the only problem is it doesnt count and display the number of binary 255s, it only goes up to 254!!
using namespace std;
unsigned char byte;
unsigned int numberofbytes;
int i, num=0, number=0;
ifstream file("Binary File", ios::in||ios::binary);
byte =(unsigned char) signed_character;
cout<<"There are "<<num<<" "<<number<<" s in this file \n";
Anyone able to give me a clue of why its doing this??