I am in the process of learning c++. So i know a method by which you send something to function and then work as if it was call by value but actually it is call by reference
Arrays are by default converted to pointers, which are then passed as reference. So, there is no provision for explicitly passing arrays by reference. That is,
void list_cities(int number, City &p[])
is not p[]
being passed as reference, but makes p[]
an array of references.
Code:
void list_cities(int number, City p[])
{
for(int i=0; i