Making a constructor for a array of character.
Code:
class Robot{
char name[15]; //assign to char n
int x, y , direction;
void ToString(int d);
public:
Robot(char *n, int eks, int why, int d);
void print();
void Move();
void Turn(int to);
bool At(int eks, int why);
void step();
};
Robot::Robot(char *n, int eks, int why, int d)//Constructor
{
name=*n;
eks=x;
why=y;
direction=d;
}
Hi guys,, how do i assign char name[] in the class to char n in the constructor?
pls help,, any explanation or solution will do...