I came across this C++ code. What are the issues in it? I can see that copy and assignment will be an issue, because a pointer is used as data member.
class Vehicle
{
char const* type;
public:
Vehicle(char const* tt) : type(tt) {}
char const* getType() const
{
return type;
}
~Vehicle()
{
delete type;
}
};