Something like this might do the job for you. MAKE SURE the LENGTH of the cstring you are passing is NOT greater that name! "humidityControl" is more that 10 characters!
class control {
public:
control(char *controlName) {
char i=0;
do{
name[i] = controlName[i];
++i;
}while(controlName[i]!=0); //since a cstring is always null terminated.
name[i] = 0;
}
private:
char name[20]; //increased the array size!
};
void setup() {
control humidityControl((char*)"humidityControl"); //casting of string for good measure! ;)
}
void loop() {
}