class and objects

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • amir nazir
    New Member
    • Sep 2018
    • 1

    class and objects

    how can i simply pass an array from constructor without using pointers?
  • weaknessforcats
    Recognized Expert Expert
    • Mar 2007
    • 9214

    #2
    Use a vector. Have the constructor return a copy of the vector.
    True, the vector may use pointers but that's not your problem.

    You could also return an object that you design that contains the array. However, you will just duplicate code in vector.


    Read this:

    Comment

    Working...