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....
Code:
{ 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_
Code:
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]; }
seems simple....but gives wacky stuff....