Access to initialized vectors from several class methods

closed account (N8RzwA7f)
Hello,
I have several initialized vectors and iterators that I'd like to be able to access from several class functions .
how would I do this without having to enter the same (rather big ) amount of code in two or more places?
thanks
You can use the same techniques as you would to make any data available to multiple functions. I'd recommend bundling them up into an object, so that you can pass them around between functions conveniently, if that makes sense with your design.
Last edited on
closed account (N8RzwA7f)
Yes , but I want to initialize these vectors with several values, and that wasn't possible to do in the class header file ? I understand I can declare vectors like that but , I need certain values in them.
thanks
You should be able to do it in the class constructor.
Topic archived. No new replies allowed.