Overloading Enumerated Types?
How do you overload an enumerated type? For example:
Code:
#include<iostream>
using namespace std;
enum example operator++(enum example& rs,int)
{
return (enum example) (rs +1);
}
int main()
{
char s_print[3][10] = {"Just", "a", "string"};
enum example
{
just,
a,
test
};
for(enum example statement = just; statement <= test; statement++)
{
cout << s_print[statement];
}
return 0;
}
Can someone compile this and fix it. The only complaint from the compiler is the overloading attempt in the for loop. I need a C++ers advice.