Hi. I believe this should be a simple question. Basically I have a class, Student. where I want to get a name, and set a name, this is what I got so far:
void Student::setName(char name[])
{
itsName = name;
}
char[] Student::getName();
{
return itsName;
}
itsName is the private member.
char itsName[30]
I don't know how to copy one string to another. Can anybody help me?
Question
saiz66
Hi. I believe this should be a simple question. Basically I have a class, Student. where I want to get a name, and set a name, this is what I got so far:
void Student::setName(char name[])
{
itsName = name;
}
char[] Student::getName();
{
return itsName;
}
itsName is the private member.
char itsName[30]
I don't know how to copy one string to another. Can anybody help me?
Link to comment
Share on other sites
10 answers to this question
Recommended Posts