Can't initalize a vector with a variable int : I was under the impression that vector could be created using a variable integer. I got this impression from the second answer here: http://stackoverflow.com/questions/14459248/how-to-create-an-array-when-the-size-is-a-variable-not-a-constant

However I still get the "constant int" error message for the code below:

    #include <vector>
    size_t ports_specified = std::count(Ports.begin(), Ports.end(), '+');
    const int num_ports = static_cast<int>(ports_specified++);
    std::vector<string> port_info[num_ports];

Any ideas?