vector.push_back

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • collsion
    New Member
    • Feb 2008
    • 1

    vector.push_back

    I have a private vector in Class A, after the constructor called, this vector is assigned because I put (for int i=0;i<vec.size( );i++) {cout<<vec[i]<<endl;} in side the constructor just to make sure vector is initilized and has size.
    but when the accessor function is called, it seems that private vector is not assigned any value, the size is still 0. so what's going on? any help would be appreciated.

    YZ
  • hsn
    New Member
    • Sep 2007
    • 237

    #2
    you have to explain you code more if you print the class or the part where the function is would be very helpful
    but i think that you are not assigning any values to the vector
    did you enter data into the vector so it could have a size and some values?
    Last edited by sicarie; Feb 24 '08, 03:28 PM. Reason: Do adding extra question marks make it more of a conundrum? Or just more curious?

    Comment

    Working...