Click to See Complete Forum and Search --> : mystik error


epirasta
December 4th, 2003, 11:46 PM
i have this class..

class IObject
{
public:
virtual string ToString() = 0; // Get a string representation of the object.
virtual string GetType() = 0; // Get the type of the object.
virtual bool Equals(IObject &value) = 0; // Returns true if the given type and content are equal.
virtual IObject* Clone() = 0; // Create a new instance by making a deep copy of the current object data.
};

and this error:
IObject.h(4) : error C2146: syntax error : missing ';' before identifier 'ToString'
IObject.h(4) : error C2433: 'IObject::string' : 'virtual' not permitted on data declarations
IObject.h(4) : error C2501: 'IObject::string' : missing storage-class or type specifiers
IObject.h(4) : warning C4183: 'ToString': missing return type; assumed to be a member function returning 'int'

i don't why..
thx a lot if u can help me..:confused:

vicodin451
December 5th, 2003, 07:46 AM
It would appear as if the compiler doesn't know what a "string" is. Are you meaning std::string, or System::String, perhaps?

epirasta
December 7th, 2003, 07:37 AM
in fact, i am an student and it is a project that i must return, so i havn't right to change the syntax of this class arfff arfff...
but it is true that that compiles whith "std::string"
thx :)