I am a newbie to C++ and am trying to pass an array to a function and then display the contents of this array through the function. The array is populated through a different function though both functions reside within the same class. I am struggling to figure out how to execute the function object to execute the display function. Listed below are all of the code components:
//=============================================
Monop.h
Code:
//Purchase Property Class
class PurchaseProperty
{
public:
void PropInit(void);
char Display();
char DisplayProp(char [],int);
private:
};
//=============================================
MonopFunct.cpp
Code:
#include <iostream>
#include "Monop.h"

using namespace std;
using std::cout;

void PurchaseProperty::PropInit()
{
char *PropNameArray[] = {"Mediterranean Avenue","Baltic Avenue","Oriental Avenue","Vermont Avenue","Connecticut Avenue","St. Charles Place","States Avenue",
"Virginia Avenue","St. James Place","Tennessee Avenue","New York Avenue","Kentucky Avenue","Indiana Avenue","Illinois Avenue",
"Atlantic Avenue","Ventnor Avenue","Marvin Gardens","Pacific Avenue","North Carolina Avenue","Pennsylvania Avenue","Park Place",
"Boardwalk"}; 

float PropCostArray[] = {60,60,100,100,120,140,140,160,180,180,200,220,220,240,260,260,280,300,300,320,350,400};

float PropRentArray[] = {2,4,6,6,8,10,10,12,14,14,16,18,18,20,22,22,22,26,26,28,35,50};

float PropRent1Array[] = {10,20,30,30,40,50,50,60,70,70,80,90,90,100,110,110,120,130,130,150,175,200};

float PropRent2Array[] = {30,60,90,90,100,150,150,180,200,200,220,250,250,300,330,330,360,390,390,450,500,600};

float PropRent3Array[] = {90,180,270,270,300,450,450,500,550,550,600,700,700,750,800,800,850,900,900,1000,1100,1400};

float PropRent4Array[] = {160,320,400,400,450,625,625,700,750,750,800,875,875,925,975,975,1025,1100,1100,1200,1300,1700};

float PropHotelRentArray[] = {250,450,550,550,600,750,750,900,950,950,1000,1050,1050,1100,1150,1150,1200,1275,1275,1400,1500,2000 };

float PropHouseCostArray[] = {50,50,50,50,50,100,100,100,100,100,100,150,150,150,150,150,150,200,200,200,200,200};

float PropHotelCostArray[] = {50,50,50,50,50,100,100,100,100,100,100,150,150,150,150,150,150,200,200,200,200,200};
};

char PurchaseProperty::Display()
{
int cnt;
for(cnt = 0; cnt < 22; cnt++)
{
cout << "Program is Working";
}
return 0;
}

char PurchaseProperty::DisplayProp(char PropNameArray[], int)
{
int cnt;
for(cnt = 0; cnt < 22; cnt++)
{
cout << PropNameArray[cnt];
}
return 0;
}
//=============================================
Main.cpp
Code:
#include <iostream>
#include "Monop.h"

using std::cout;
using std::cin;
using std::endl;

char DisplayProp(char PropNameArray[],int);

int main()
{

PurchaseProperty object;
object.PropInit();
object.DisplayProp(PropNameArray,22);

return 0;
}
//=============================================