what do you think is an efficient way of implementing a lookup table in c++
i'd use a vector or some other safe container, except calling push_back 400 times seems ridiculous.....
and i've currently got it as a cstyle array, but that is giving me weirrrrrrrrd results....
{
public:
LookupTable();
int lookupElectrodeNumber(int i);
private:
int base_filter[21][13];
int id_filter[13][21];
int number_to_filter [100];
};
#endif//LOOKUP_TABLE_
class LookupTable: public QWidget
{
public:
LookupTable();
int lookupElectrodeNumber(int i);
private:
int base_filter[21][13];
int id_filter[13][21];
int number_to_filter [100];
};
#endif//LOOKUP_TABLE_
To copy to clipboard, switch view to plain text mode
LookupTable::LookupTable()
{
int::number_to_filter[] = { blah blah blah....a heck of a lot of numbers};
}
int LookupTable::lookupElectrodeNumber(int i)
{
return number_to_filter[i];
}
LookupTable::LookupTable()
{
int::number_to_filter[] = { blah blah blah....a heck of a lot of numbers};
}
int LookupTable::lookupElectrodeNumber(int i)
{
return number_to_filter[i];
}
To copy to clipboard, switch view to plain text mode
seems simple....but gives wacky stuff....
Bookmarks