Hey all i am trying to compile my code but i keep getting "redefinition; different basic types". Here is the error log:
And here is my code that its having problems with:f:\c++2\addressClass\addressClass.cpp(145): error C2556: 'std::string extPersonType::getNumber(void) const' : overloaded function differs only by return type from 'int extPersonType::getNumber(void) const'
f:\c++2\addressClass\addressClass.cpp(35) : see declaration of 'extPersonType::getNumber'
f:\c++2\addressClass\addressClass.cpp(97): error C2371: 'addressType::getZip' : redefinition; different basic types
f:\c++2\addressClass\addressClass.cpp(16) : see declaration of 'addressType::getZip'
f:\c++2\addressClass\addressClass.cpp(145): error C2371: 'extPersonType::getNumber' : redefinition; different basic types
f:\c++2\addressClass\addressClass.cpp(35) : see declaration of 'extPersonType::getNumber'
f:\c++2\addressClass\addressClass.cpp(97): error C2556: 'std::string addressType::getZip(void) const' : overloaded function differs only by return type from 'int addressType::getZip(void) const'
I do not really know what i am doing wrong? Any help would be great!Code:#include <string> #include <assert.h> #include <iostream> #include <windows.h> using namespace std; class addressType { public: void printAddress() const; void setAddress(string street, string city, string state, int zip); string getStreet() const; string getCity() const; string getState() const; int getZip() const; addressType(string street = "", string city = "", string state = "", int zip = 0); private: string addrStreet; string addrCity; string addrState; int addrZip; }; class extPersonType { public: void printPerson() const; void setNameNum(string first, string last, int number); void setPersonType(string pt); string getFirstName() const; string getLastName() const; string getPersonType() const; int getNumber() const; extPersonType(string first = "", string last = "", int number = 0000000000); private: string firstName; string lastName; string personType; int phoneNumber; }; string addressType::getZip() const { return addrZip; } string extPersonType::getNumber() const { return phoneNumber; }
David



LinkBack URL
About LinkBacks



