Access to initialized vectors from several class methods

Apr 5, 2016 at 11:06pm
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
Apr 6, 2016 at 10:20am
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 Apr 6, 2016 at 11:21am
Apr 6, 2016 at 3:35pm
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
Apr 6, 2016 at 4:06pm
You should be able to do it in the class constructor.
Topic archived. No new replies allowed.