c567591
asked on
VC to C++ Builder code conversion
I am trying to convert some code from VC to C++ Builder 5 pro.
For the line:
operator string() const;
I get these errors:
Error E2076 .\strtok.h 32: Overloadable operator expected
Error E2040 .\strtok.h 32: Declaration terminated incorrectly
Farther down in the implementation:
inline StrTok::operator string() const
{
if (curToken)
return string(curToken,curTokenLe ngth);
return string("");
}
I get these errors:
Error E2076 .\strtok.h 59: Overloadable operator expected
Error E2040 .\strtok.h 59: Declaration terminated incorrectly
This is a small and relatively uncomplicated class, but I am stuck on what the Borland C++ Builder compiler is looking for.
What should I replace these with?
I tried AnsiString(), but it gave the exact same errors.
For the line:
operator string() const;
I get these errors:
Error E2076 .\strtok.h 32: Overloadable operator expected
Error E2040 .\strtok.h 32: Declaration terminated incorrectly
Farther down in the implementation:
inline StrTok::operator string() const
{
if (curToken)
return string(curToken,curTokenLe
return string("");
}
I get these errors:
Error E2076 .\strtok.h 59: Overloadable operator expected
Error E2040 .\strtok.h 59: Declaration terminated incorrectly
This is a small and relatively uncomplicated class, but I am stuck on what the Borland C++ Builder compiler is looking for.
What should I replace these with?
I tried AnsiString(), but it gave the exact same errors.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Thanks for the quick answer that worked!