First, your GetInput function could be a lot simpler:
Code:
void Get_Input (Person &tmp){
char name[25];
char lname[25];
char soc[25];
cout <<"Input a name ";
cin >> name;
tmp.SetfName(name);
cout <<"Input a last name ";
cin >> lname;
tmp.SetlName(lname);
cout <<"Input a SSN (9 digits) ";
cin >> soc;
tmp.SetSSN(soc);
}
At least I'm sure that's how it should go. You might need to change the '.' to '->' so tmp->SetfName(name); etc.
The first error you are getting is because you aren't using objects correctly. Once you make a class of Person, it's like another variable. So you need lines of code like these:
Code:
Person someFirstPerson;
//using the function from above:
Get_Input(someFirstPerson);
And that should make up most of your main function.
Code:
name = Person::GetfName;
This is invalid, Person::GetfName(). You are trying to use the declaration of the function. After declaring, do this:
Code:
Person someFirstPerson;
Get_Input(someFirstPerson);
tmpName = someFirstPerson.GetfName();
To fix the warning, change this:
Code:
bool Person::validateSSN (char* soc){
value = soc;
Length = findLength();
if (Length < 9 && Length > 9)
return false;
else if (Length == 9)
return true;
}
to
Code:
bool Person::validateSSN (char* soc){
value = soc;
Length = findLength();
if (Length == 9)
return true;
else
return false;
}
When using if/else checks, the first if should check what is most likely to return true (this actually doesn't effect most computers because they're so fast now), and you need to learn to make your checks more efficient. Also, you need to double check your if statement. You are trying to see if Length is less than 9 AND if Length is greater than 9. You should use the OR ( two pipes, |||), or just use the code I gave.