![]() |
|
|
|
Thread Tools | Display Modes |
|
|
|
|
#1 |
|
Newbie
Join Date: Sep 2004
Posts: 29
Rep Power: 0
![]() |
Enumerations as loop variables
I've been programming in C mostly, and I've become accustomed to being able to do things like this:
typedef enum TEST_ENUM_t
{
TEST0,
TEST1,
TEST2,
TEST3
} TEST_ENUM_t;
TEST_ENUM_t TestIndex;
for (TestIndex = TEST0; TestIndex <= TEST3; TestIndex++)
{
// Do something
}Well, now I'm trying to do something like this for some test driver software written in Visual C++ which will be used to test C functions. When I attempt to do something like I have above in Visual C++, I get the following error: error C2676: binary '++' : 'TEST_ENUM_t' does not define this operator or a conversion to a type acceptable to the predefined operator Is there a way to do something similar to the code above in Visual C++? Thank you. |
|
|
|
| Bookmarks |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| for loop variables | emdiesse | Java | 8 | May 17th, 2007 10:20 PM |
| Hanging For loop in C++ | can342man | C++ | 20 | Apr 30th, 2006 7:27 AM |
| Help in QBASIC (I think it's similar to VB) | phoenix987 | Visual Basic | 3 | May 9th, 2005 12:33 PM |
| Help with a QBASIC program | phoenix987 | Other Programming Languages | 4 | May 5th, 2005 12:27 PM |
| Timing loop problems | badbasser98 | C++ | 11 | Mar 10th, 2005 8:30 PM |