Y
Ying Yang
Hi,
<code snippet>
char* Car::toString()
{
//Example [XR, Holden]
char* str = {"[", carID, ",", carName, "]"};
return str;
}
Note: carID and carName are private variables of class Car
Compile Error: Car.cpp initializer for scalar variable requires one element
Basically, the toString() method doesn't work. Any help appreciated. Note,
I'm not interested in working with the newer string data type because I want
to learnto do it with pointers to char.
Regards
wewewe
<code snippet>
char* Car::toString()
{
//Example [XR, Holden]
char* str = {"[", carID, ",", carName, "]"};
return str;
}
Note: carID and carName are private variables of class Car
Compile Error: Car.cpp initializer for scalar variable requires one element
Basically, the toString() method doesn't work. Any help appreciated. Note,
I'm not interested in working with the newer string data type because I want
to learnto do it with pointers to char.
Regards
wewewe