i made a class test program with telephone directory.
it writes name and telephone number but not surname
i have used return name,surname which does not carry both string.
is it possible to do them without writing another function script.
thanks in advance
#include <cstdlib>
#include <iostream>
using namespace std;
class telephone_book
{
public:
telephone_book (string name,string surname,int number)
{
setrecord(name,surname,number);
}
void setrecord (string name,string surname,int number)
{
name1=name;
surname1=surname;
number1=number;
}
string takerecord()
{
return name1,surname1;
}
int takerecord1 ()
{
return number1;
}
void displaymessage ()
{
cout << "telephone book \n"<< takerecord()<<"?"<<takerecord1()<<endl;
}
private:
string name1,surname1;
int number1;
};
int main(int argc, char *argv[])
{
telephone_book record1("burcin","erek",111111);
telephone_book record2("deniz","xxxx",222222);
cout << "record1="<< record1.takerecord()<<" "<<record1.takerecord1()
<< "\nrecord2 ="<< record2.takerecord()<< " "<<record2.takerecord1()<<endl;
system("PAUSE");
return EXIT_SUCCESS;
}