yea we have to use visual studio though... i made some changes to the assignment operator overload the type, and these are the errors im getting...
1>c:\users\matt\documents\visual studio 2008\projects\cs210\cs210\mystring.cpp(66) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>c:\users\matt\documents\visual studio 2008\projects\cs210\cs210\mystring.cpp(66) : error C2556: 'int MyString::operator =(const MyString &)' : overloaded function differs only by return type from 'MyString MyString::operator =(const MyString &)'
1> c:\users\matt\documents\visual studio 2008\projects\cs210\cs210\mystring.h(18) : see declaration of 'MyString::operator ='
1>c:\users\matt\documents\visual studio 2008\projects\cs210\cs210\mystring.cpp(66) : error C2371: 'MyString::operator =' : redefinition; different basic types
1> c:\users\matt\documents\visual studio 2008\projects\cs210\cs210\mystring.h(18) : see declaration of 'MyString::operator ='
1>c:\users\matt\documents\visual studio 2008\projects\cs210\cs210\mystring.cpp(66) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>c:\users\matt\documents\visual studio 2008\projects\cs210\cs210\mystring.cpp(66) : error C2556: 'int MyString::operator =(const MyString &)' : overloaded function differs only by return type from 'MyString MyString::operator =(const MyString &)'
1> c:\users\matt\documents\visual studio 2008\projects\cs210\cs210\mystring.h(18) : see declaration of 'MyString::operator ='
1>c:\users\matt\documents\visual studio 2008\projects\cs210\cs210\mystring.cpp(66) : error C2371: 'MyString::operator =' : redefinition; different basic types
1> c:\users\matt\documents\visual studio 2008\projects\cs210\cs210\mystring.h(18) : see declaration of 'MyString::operator ='
1 2 3 4 5 6 7 8 9
|
MyString MyString::operator= (const MyString& s)
{
pData = s.pData;
length = s.length;
return *this;
}
MyString operator= (const MyString &s);
|
the six errors are from the assignment operator overload function. thanks for any help.