I'm trying to print out elements of a vector that is made up of structures. Here is the definition of the vector and its contents:
struct H_Data{
double count[2];
double min, max;
list <double> Ref_Data;
};
struct Histogram
{
std::vector<H_Data> H;
}Hist[MAX_DIM];
Now I created a vector H and I want to print out all of its contents. I tried doing this with a for loop:
for (int i=0; i<H.size();i++){
cout << H[i] << endl;
}
But I get a type error here.
./CD.h:155:14: error: invalid operands to binary expression ('ostream' (aka
'basic_ostream<char>') and 'value_type' (aka 'H_Data'))
cout << H[i] << endl;
Any help on how to print the contents?