Histogramm

hello guys,
i tried several times to write a code for a histogramm. But it does not compile.
I would be glad and very thanxful, if someone can help me out :)
Best regards.
Amber

# include <stdlib.h>
#include <fstream>
#include <vector>
#include <iostream>


using namespace std;

int main (){
ofstream out ("out.raw",ios_base::binary);
unsigned char randomnumber;
for (int i=0; i<255;i++)
{
randomnumber=rand()%255;
out.write ((char*)&randomnumber,1);

}
vector <int>number (256);
for (int b=0; b< 256;b++)
{
//char in;
//ifstream in("in.raw",ios_base::binary);
in.read ((char*)& randomnumber,1);
zahl[randomnumber]++;
}
int summ=0;
for(int b=0; b<256; b++)
{
cout<<b<<":"<<number[b]<<"\n";
summe=summ+number[b];
}
cout<<summ;
return 0;
}
Please, do not double post. It clutters forums and spreads attempts to help you. Another thread: http://www.cplusplus.com/forum/beginner/171902/
Topic archived. No new replies allowed.