It sounds like you need an associative container structure, not an array. Arrays are always of a fixed length set at compile time; you cannot change their size at run time. Your declaration int lineOpt[]
is not legal.
Consider std::map<unsigned int, unsigned int>
or std::unordered_map<unsigned int, unsigned int>
.