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;

}

error 1:

/*you are writting*/
secretType () //default constructor
{name = " "; age = 0; weight = 0; height = 0;}
/*remember your 'name' var was like: char name[10]*/
/*but you are assigning it a value which is an address to a string of size 2 i.e. " ". one space and the \0 character.*/
/*This is not a way how u can copy one string to other*/

use strcpy()


error 2:

/*your prototype is*/
char setName ();

/*but u are defining another member as:*/
char secretType::getName(char name)

check the difference yourself.

And anyways, I guess you are trying to set the name which is a string and not a character, so your prototype should be like

void setName(const char *name);
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.