424,279 Members | 1,905 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,279 IT Pros & Developers. It's quick & easy.

class and objects

P: 1
how can i simply pass an array from constructor without using pointers?
Sep 14 '18 #1
Share this Question
Share on Google+
1 Reply

Expert Mod 5K+
P: 9,197
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:

Sep 16 '18 #2

Post your reply

Sign in to post your reply or Sign up for a free account.