I have a switch function in a program that needs a little help. The switch function is as follows
ostream& displayShapes( ostream& outfile, Shapes ashape)
{
switch( ashape )
{
case Triangle: outfile<< "Triangle" ; break;
case Circle: outfile << "Circle" ; break;
case Rectangle: outfile << "Rectangle" ; break;
case Square: outfile << "Square" ; break;
}
cout << endl << endl;
return displayShapes;
}
The problem I am having is with the return. I am not sure what to place here, seems everything I tried gives an error. The most current error is
"error C2440: 'return' : cannot convert from 'std::ostream &(__cdecl *)(std::ostream &,Shapes)' to 'std::ostream &'"
any thoughts on what I need to do here?