Code:
/*
Terrance Lynch
cpp memo 1
November 10, 2002
*/
#include <iostream>
using namespace std;
class Name
{
public:
Name();
const char* GetName() const;
private:
char NameInput[513];
};
class IntRequest
{
public:
IntRequest(const char *);
const int* GetInt() const;
private:
int ThePhoneNumber;
};
class zipRequest
{
public:
zipRequest(const int *);
const int* getZip() const;
private:
int theZipCode;
};
class testFour
{
public:
testFour(const char *, const int *, const int *);
};
int main()
{
Name n1;
IntRequest ir1(n1.GetName() );
zipRequest zp1(ir1.GetInt() );
testFour t4(n1.GetName(), ir1.GetInt(), zp1.getZip() );
return 0;
}
Name::Name()
{
cout << "Please enter your name: " << endl;
cin.getline(NameInput, sizeof(NameInput));
}
const char* Name::GetName() const
{
return NameInput;
}
IntRequest::IntRequest(const char *NameInput)
{
cout << NameInput << ", please enter you phone number: " << endl;
cin >> ThePhoneNumber;
}
const int* IntRequest::GetInt(int) const
{
return ThePhoneNumber;
}
zipRequest::zipRequest()
{
cout << "Please enter your zip code: " << endl;
cin >> theZipCode;
}
const int* zipRequest::getZip(int) const
{
return theZipCode;
}
testFour::testFour(const char *NameInput, const int *ThePhoneNumber, const int *theZipCode)
{
cout << NameInput << ThePhoneNumber << theZipCode << endl;
}
I just finished my c class, and now I'm learning c++, and I'm having a little difficulty. Please help, I keep getting three compiler errors I don't understand.
Thank you