O
omariqbalnaru
#ifndef ADDRESS_H
#define ADDRESS_H
class Address
{
private:
int house;
int block;
char* town;
char* city;
public:
Address(char*,int, char*, int);
friend ostream& operator<<(ostream&, const Address&);
};
#endif
ostream& operator<<(ostream& a, const Address& b)
{
a<<"House No "<<b.house<<endl;
a<<"Block Number "<<b.block<<endl;
a<<"Town "<<b.town<<endl;
a<<"City "<<b.city<<endl;
return a;
};
Can anybody plrase help me to identify the error here? It is not
letting me access the data members of the class.
#define ADDRESS_H
class Address
{
private:
int house;
int block;
char* town;
char* city;
public:
Address(char*,int, char*, int);
friend ostream& operator<<(ostream&, const Address&);
};
#endif
ostream& operator<<(ostream& a, const Address& b)
{
a<<"House No "<<b.house<<endl;
a<<"Block Number "<<b.block<<endl;
a<<"Town "<<b.town<<endl;
a<<"City "<<b.city<<endl;
return a;
};
Can anybody plrase help me to identify the error here? It is not
letting me access the data members of the class.