Answer the question
In order to leave comments, you need to log in
How to output the data of the returned array?
Hi all!
Filled an array of type int and returned the array to main using a function.
How to display all elements of an array in main through cout so that the address in memory is not displayed.?
the point is that in a standard way like: cout << objectname->getMassiv(); as I said, it displays the address and I understand why. But I can not figure out how to display the elements in this case.
Thanks in advance!
Answer the question
In order to leave comments, you need to log in
Display each element of the array element by element.
for(size_t i = 0; i < array.size(); ++i) {
cout << array[i];
}
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question