[Dev-C++] Make switch condition an enum
Open Source C & C++ IDE for Windows
Brought to you by:
claplace
|
From: Daniel G. <sp...@ho...> - 2002-10-18 11:45:18
|
Hi,
I have the following chunk of code, and I've been asked to make the switch
(SomeError) statement use an enum. Well I was told to "make that an enum".
How would I create the enum and use it in the switch statement?
// Get error strings
switch (SomeError)
{
case ERROR_ONE:
DebugOut = _T("Error One!");
break;
case ERROR_TWO:
DebugOut = _T("Error Two!");
break;
default:
DebugOut = _T("Unspecified error!");
break;
}
_________________________________________________________________
Protect your PC - get McAfee.com VirusScan Online
http://clinic.mcafee.com/clinic/ibuy/campaign.asp?cid=3963
|