Hi, I declared and implemented a print() function in a class. But when I call this function it is giving me an error: which says that function does not take 0 arguments. But what should my arguments be.
I have posted the part of the code for more specification.
Thanks.
/************class header******************************/
class addressType
{
private:
string St_address;
string city, state;
int Zip;
public:
void print_add(string, string, string, int);
void get_add();
void set_add(string, string, string, int);
addressType();
~addressType();
};
#endif
/*****************implementation of print & set function*****/
void addressType::set_add(string street, string cit, string st, int zip)
{
St_address = street;
city = cit;
state = st;
Zip = zip;
print_add(St_address, city, state, Zip);
return;
}
void addressType::print_add(string str, string Cit, string St, int Z)
{
cout<<"Address: "<<str<<endl;
cout<< Cit <<","<<St<<endl;
cout<<"Zip: "<<Z<<endl;
return ;
}
/******** main()********************/
int main()
{
addressType Avi;
Avi.get_add();
Avi.print_add(); //error C2660 function does not take 0 arguments.
I am trying to print the user's address here.
return 0;
}