Originally Posted by
Programmer_P
And the std::string type doesn't have a '==' operator.
I see. Compile this program and tell us the compile error. If there is no compile error, run the program and tell us the output:
Code:
#include <iostream>
#include <string>
int main()
{
std::string myStdString = "--help";
if (myStdString == "--help")
{
std::cout << "Programmer_P";
}
else
{
std::cout << "laserlight";
}
std::cout << " is wrong." << std::endl;
}
Originally Posted by
Programmer_P
Yeah...so why not involve a class type??
That is precisely what I am telling you to do: involve a class type by constructing a std::string from one of the null terminated C-style strings.