Hi need some help with this half attempt at a deal or no deal game
I would appreciate your help very much the problem is in the comments.
#include <iostream>
#include <vector>
using namespace std;
const int n_suitcase = 26;
struct Suitcase{
int money_val;
};
//hold the list of suitcase obj
vector<Suitcase> Mysuitcases;
vector<Suitcase>::iterator it;
//function proto
void Sort_case(Suitcase &cases);
void Show_cases();
//get val inside each suitcase
int Get_val(vector<Suitcase> a,int box_id)
{
//how do i return the val of the suitcase money_val member ?
return ?????????
}
void Remove_suitcase(int box_id)
{
//how do i remove the specified suitcase object from the vector without disturding the others or effecting the size of the vector ?
}
int main()
{ //create suitcases
Suitcase suitcase[n_suitcase];
//fill each suitcase with a money val and push back obj into vector
for(int a=0;a<n_suitcase;a++)
{
Sort_case(suitcase[a]);
Mysuitcases.push_back(suitcase[a]);
}
Show_cases();
cin.get();
return 0;
}
void Sort_case(Suitcase &cases)
{
cases.money_val = 100;
}
void Show_cases()
{
it = Mysuitcases.begin();
for ( it=Mysuitcases.begin() ; it < Mysuitcases.end(); it++ )
cout << " " << *it;
}
When i complie this i get
error C2679: binary '<<' : no operator found which takes a right-hand operand of type 'Suitcase' in the showcase function any idea why ?