class House
{
public:
int write();
int Display();
};
//this function writes information into a text file so im fstreaming
int House::write()
{ //then i have this object which is an array..
House available[100];
....
....
}
//the question is how can i use/access (or whatever the word is) the object available[100]
//inside the next function which is the int Display()..
int House::Display()
{
......
}
ummm newb question, what is that ".something"? what should I replace there? :D
and if you say int House::Display(House* obj1)
then i have to place a parameter in my function display in my class? D:
You can't access the available array from House::write() inside of House::Display() because available is a local variable. Instead, I think what you want to do is pass the available array to write() and Display:
1 2 3 4 5 6 7 8 9 10
House::write(House available[]);
House::Display(House available[]);
...
{
House available[100];
House someHouse;
...
someHouse,write(available);
someHouse.Display(available);
}