I am getting 3 error messages:
-cannot convert from 'const char [2]' to 'char [10]'
2messages of: 'char secretType::setName(char)' : overloaded member function not found in 'secretType'
#include <iostream>
#include <cstring>
using namespace std;
class secretType
{private:
char name[10]; *error message here
int age, weight;
double height;
public:
char setName ();
int setAge ();
int setWeight ();
double setHeight ();
const char getName (); //accessor function
const int getAge (); //accessor function
const int getWeight (); //accessor function
const double getHeight (); //accessor function
secretType () //default constructor
{name = " "; age = 0; weight = 0; height = 0;}
};
/********** 10 Member function definitions ***********/
char secretType::setName(char name)
{n = name;
}
char secretType::getName(char name)
{cin.getName(name);
cin.ignore(); //ignore the '\n' in the input buffer
cout << "The name you entered is:\n";
//Loop through the array printing each character
for(int index = 0; name[index] != '\0'; index++)
{cout << name[index];}
return 0;
}