#include "io.hh"
#include "string.hh"
int main()
{
{
string s = "cat";
cout << "** should say 'cat'\n";
PRINT(s);
}
{
string s = "cat";
string t;
t = s;
cout << "The following tests should give affirmative answer:\n";
PRINT(strings_equal(s,t));
t << "bat";
PRINT(!strings_equal(s,t));
string u;
u = s;
u << "bat";
PRINT(strings_equal(t,u));
}
{
string a = "apple";
string b = "banana";
PRINT(!strings_equal(a,b));
}
{
string a = "apple";
string b = "apple";
PRINT(strings_equal(a,b));
}
{
string a = "apple";
PRINT(strings_equal(a,"apple"));
}
{
string a = "apple";
string b = "appl";
b << "e";
PRINT(strings_equal(a,b));
}
{
string s;
s << "hello";
s << ", ";
s << "world";
PRINT(s);
PRINT(strings_equal(s,"hello, world"));
}
{
string s;
const char* a1 = "zip";
s << a1;
PRINT(s);
}
}