Search:

Type: Posts; User: Vandrian

Search: Search took 0.01 seconds.

  1. Replies
    5
    Views
    1,330

    I wasn't able to get it to work. This is what...

    I wasn't able to get it to work. This is what main looks like (I haven't changed the class Object). Also something else I don't understand is that it prints stats() now no matter what and it isn't in...
  2. Replies
    5
    Views
    1,330

    Thanks! ! !

    I was really banging my head on that one. The reason I was trying to use pointers was because (I didn't get the Object vector to work either), and also my book that I am learning from used pointers...
  3. Replies
    5
    Views
    1,330

    Vector of Objects = crash and burn

    I want to...
    1) make a simple class Object that stores some integers etc...
    2) put this Object class into a vector
    3) Loop through the vector and call the class member function stats() which...
  4. Thanks again! I never thought about iterators....

    Thanks again! I never thought about iterators. Reading that artical made me think about other things I don't know and will have to experiement with (pointers to an unsorted list which is then sorted...
  5. don't understand myVector.reserve(numSpaces)

    I'm going through a book and I've looked this up, but don't understand why (or maybe I have to) use reserve. Since it is a vector why is there a need to reserve memory? Is it just a way so that it...
  6. Replies
    2
    Views
    1,934

    Ahhh, stupid mistake! This is what I get for...

    Ahhh, stupid mistake! This is what I get for programming late at night. I didn't even see it though. Thanks!
  7. Replies
    2
    Views
    1,934

    int vector outputs wrong numbers

    Maybe I have a casting problem or something not sure. I enter 1 into my vector and then 2, 3 etc... then when I print I get 49, 50, 51. I use the iterator and a regular loopto test output. What did I...
  8. Replies
    4
    Views
    2,018

    Thank you for answering. I went ahead and played...

    Thank you for answering. I went ahead and played around with them last night. Orignally it just looked like extra typing. Thanks!
  9. Replies
    4
    Views
    2,018

    C++ STL: Why use member iterators

    I just started C++ last week (but have been goofing around with other programming languages). I just started looking around the STL (vectors in specific) and why use the iterators? It seems like less...
Results 1 to 9 of 9