creating array of enum type
I was wondering if it is possible to create an array of enums like this:
typedef enum {
LABEL,
SCREEN_BUFFER,
PID,
ENABLED,
NUM_BYTES
} SENSOR;
static SENSOR sensors[] = {
// formula // label //screen_buffer //pid //enabled // bytes
{ "Absolute Throttle Position:", "", "11", 1, 1 },
{ "Engine RPM:", "", "0C", 1, 2 },
{ "Vehicle Speed:", "", "0D", 1, 1 }
};
If this is not possible would someone give me some pointers on how to create something similar without have to build a class for each entry and storing it in a list or something like it. I'm trying to create a static array of a bunch of information about each sensor I can access on my vehicle through its OBD-II port.
Talguy
Junior Poster in Training
96 posts since Mar 2009
Reputation Points: 10
Solved Threads: 0
Have you tried it? If so, did you receive any errors?
Duki
Nearly a Posting Virtuoso
1,475 posts since Jun 2006
Reputation Points: 817
Solved Threads: 32