Overloaded function print
- by Olga Shirokova
For one of the assignments I need to create an overloaded function print that prints an element or all elements of an array. I have no problem with printing the entire array:
for( int i = 0; i < size; i++)
cout << list [ i ] <<endl;
But how do I make the same function to print only one particular element?
The way I see it is to ask a user what to print, either one element or all numbers. Or am I missing something here?