Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

namespace

Status
Not open for further replies.

mayu03

Programmer
Oct 3, 2003
91
US
I have the following code
enum {green,red,black} ;
How do I replace this with namespace? Could it be done?
 
stupid situation. You can do it, but it does not make sence to change enum to namespace:
enum colors{green,red,black} ;
color x = green;
int y = (int)black;
change to
namespace colors
{
const int green = 1
const int red = 2;
const int black = -1;
}
int x = colors::green;
using namespace colors;
int y = black;

Ion Filipski
1c.bmp
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top