I was wondering how to use a vector in a function in the following form.
batt::additem( vector <int> inv, int id );
Is that correct or will it raise errors?
I was wondering how to use a vector in a function in the following form.
batt::additem( vector <int> inv, int id );
Is that correct or will it raise errors?
Well, you made a copy of a vector when you probably wanted a reference instead, but it should be fine.
thanks citizen!
Learn about iterators, c89c. They are a much better way to pass vectors to functions. And this is especially true when you have a big vector.
Originally Posted by brewbuck:
Reimplementing a large system in another language to get a 25% performance boost is nonsense. It would be cheaper to just get a computer which is 25% faster.