I suggest reaching for a std::vector<int>. You can then also return it from the function, or, if appropriate, it might be more suitable as a member variable instead. The alternative does involve new[], but I would not use it unless I really have to.
I suggest reaching for a std::vector<int>. You can then also return it from the function, or, if appropriate, it might be more suitable as a member variable instead. The alternative does involve new[], but I would not use it unless I really have to.
Look up a C++ Reference and learn How To Ask Questions The Smart WayOriginally Posted by Bjarne Stroustrup (2000-10-14)
Pass an address of a struct (or class) allocated on the heap around then, (as a function arg)
Thank you for your suggestions :-)
I eventually solved it by creating an int pointer.
ie
then further down just saidCode:int * temp;
Thanks for your help - my assignment (a media player) is almost now complete, got some bugs in it that I'm struggling with but i'll start another thread :-)Code:temp = new int[value];
Thanks again!
Leigh