One thing - you need to fix your function return types. Your functions are returning char - they need to return String.
Landsknecht
Need Some Guidence :)
My sig used to be, "God was my co-pilot but we crashed in the mountains and I had to eat him..."
But folks whinned and I had to change it.
But folks whinned and I had to change it.
Siebharinn I don''t see any difference in putting
char tmpname[] in
Address:utname(char tmpname[])
as a parameter or putting
Address:utname(char *tmpname)
these both r same then y u emphisizing on using the later one. Actually char tmpname[] is same as char* const tmpname.
char tmpname[] in
Address:utname(char tmpname[])
as a parameter or putting
Address:utname(char *tmpname)
these both r same then y u emphisizing on using the later one. Actually char tmpname[] is same as char* const tmpname.
Should there be two separate classes? One fore creating the contact and another viewing it?
Here is the beginning of my CreateContact class. I still have do alot to it such as it saving the contacts info to a file. How would I implement this? Thanks
class CreateContact{ public: void SetName(const char* tmpname) { name = tmpname; } void SetEmail(const char* tmpemail) { email = tmpemail; } void SetPhone(const char* tmpphone) { phone = tmpphone; } void SetPhoneb(const char* tmpphoneb) { phoneb = tmpphoneb; } void SetAddress(const char* tmpaddress) { address = tmpaddress; } void SetComment(const char* tmpcomment) { comment = tmpcomment; } private: string name; string email; string phone; string phoneb; string address; string comment;};
added string copy like Promit said to:
class CreateContact{ public: void SetName(const char* tmpname) { strcpy(name ,tmpname); } void SetEmail(const char* tmpemail) { strcpy(email ,tmpemail); } void SetPhone(const char* tmpphone) { strcpy(phone ,tmpphone); } void SetPhoneb(const char* tmpphoneb) { strcpy(phoneb ,phoneb); } void SetAddress(const char* tmpaddress) { strcpy(address ,tmpaddress); } void SetComment(const char* tmpcomment) { strcpy(comment ,tmpcomment); } private: string name; string email; string phone; string phoneb; string address; string comment;};
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement