input parameters on C++ file to a global variable

I’d like to feed a global variable some external parameters.

My actual code is:

    static const char conn_str[] =
    "user='postgres' password='' host='' port='5432' dbname='database'";

    pqxx::connection C(conn_str);
    pqxx::nontransaction N(C);

And I’d like to be able to feed the code with argv parameters and still using connection C as global.

Any thoughts?
thanks in advance…

Source: c++

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.