gramps199
2007-10-05 07:32:40 UTC
Point& Point::operator=(const Point& p)
{
if(this != &p)
{
delete [] label; //Deletes label
label = new char(strlen (*(p.label)));
strcpy(label, (*(p.label)));
x = (*(p.x)); //Copies x.
y = (*(p.y)); //Copies y
}
return *this; //Returns *this.
}
h:\point\point\point\point.cpp(64) : error C2664: 'strlen' : cannot convert parameter 1 from 'char' to 'const char *'
Conversion from integral type to pointer type requires reinterpret_cast, C-style cast or function-style cast
h:\point\point\point\point.cpp(64) : fatal error C1903: unable to recover from previous error(s); stopping compilation
With line 64 commented out:
h:\point\point\point\point.cpp(65) : error C2664: 'strcpy' : cannot convert parameter 2 from 'char' to 'const char *'
Conversion from integral type to pointer type requires reinterpret_cast, C-style cast or function-style cast
h:\point\point\point\point.cpp(66) : error C2440: '=' : cannot convert from 'double' to 'double *'
h:\point\point\point\point.cpp(67) : error C2440: '=' : cannot convert from 'double' to 'double *'