Just something I was trying to do off of the top of my head.
I've looked it over dozens of times, and I can't seem to find what I did wrong. I think it has something to do with calling on the corn variable inside the class though.
using namespace std;
static int corn;
char Y = "Y";
cout << " Is " << vegetable::corn << "a vegetable?";
cout << "Say Y for yes and N for no";
cin >> cornanswer;
if (cornanswer == Y)
cout << "YES!! You are very smart, it is a vegetable!";
cout << "Wow, you are very stupid! That answer is wrong!";
1>Mess.cpp(24): error C2628: 'vegetable' followed by 'int' is illegal (did you forget a ';'?)
1>Mess.cpp(25): error C3874: return type of 'main' should be 'int' instead of 'vegetable'
1>Mess.cpp(27): error C2440: 'initializing' : cannot convert from 'const char ' to 'char'
1> There is no context in which this conversion is possible
1>Mess.cpp(45): error C2440: 'return' : cannot convert from 'int' to 'vegetable'
1> No user-defined-conversion operator available that can perform this conversion, or the operator cannot be called