I haven't programmed in C++ for awhile and I'm trying to work on an assignment for a C++ Data Structures class, so please excuse my question. I am rusty.
Anyway I am getting a bunch of errors like:
error C2146: syntax error : missing ')' before identifier 'theStreet'
addresstype.h(9) : error C2146: syntax error : missing ';' before identifier 'theStreet'
error C2460: 'addressType::string' : uses 'addressType', which is being defined
and more
addressType.h
addressTypeImp.cppCode:#include <string> class addressType { public: addressType(string theStreet, string theCity, string theState, string theZipCode); addressType(); private: string streetAddress; string city; string state; string zipCode; };
thanksCode:#include <iostream> #include <string> #include "addressType.h" using namespace std; addressType::addressType(string theStreet, string theCity, string theState, string theZipCode) { streetAddress = theStreet; city = theCity; state = theState; zipCode = theZipCode; } addressType::addressType() //default constructor { streetAddress = ""; city = ""; state = ""; zipCode = ""; }




Reply With Quote