Thread: Constructor question

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Algorithm engineer
    Join Date
    Jun 2006
    Posts
    286

    Constructor question

    If I create a vector vec by writing
    Code:
    vector<int> vec;
    is the constructor of the vector class called or not?
    If not, is vec.size() is undefined?

    I know I can always write
    Code:
    vector<int> vec();
    or
    Code:
    vector<int> vec() = new vector<int>;
    etc, but I think I have a lot of old programs where I haven't, and I would like to know if I have to modify them.
    Last edited by TriKri; 11-26-2006 at 05:11 PM.

Popular pages Recent additions subscribe to a feed