I want to compare a cstyle string (tool) with another cstyle string (tool2).
The main problem is that tool2 is in another class as tool, and tool is in a different class itself, therefore I cannot compare an object with a cstyle string.
Any suggestions to get around this problem?
Example:
1 2 3 4 5 6 7 8
//This function is placed in the same class as tool.
bool CompareTool (const Box & tool2 )
{
if (strcmp(tool, tool2))//Cannot compare cstyle string with object.
returntrue;
elsereturnfalse;
}
Lets say the class CreateTool has tool in it.
All strings are stored as different objects. The objects are created within the main() function, and then stored into an array of objects that is in another class (Box).
My problem is how to use tool2 from Box and implement it in CreateTool to compare with tool.
:/