Okay, so I have got everything working like a charm, client, server, the whole toot, everything compiles, server listens, client connects, whoopee.
Then I run into this issue of passing the currency codes as character arrays. I mean, this is basic C and I'm lost
The problem is, you can't say:
if (fromCode == toCode)
because they're not strings. So, duh, just
#include <string>
string str1 = fromCode;
string str2 = toCode;
Right? Nope. Doesn't work. For some reason, the include is ignored in this environment.
I've set up a test program where I have a function like this:
void myFuncion(char *testStr) {
string myStr = testStr;
cout << myStr;
};
This works. You can say:
myFunction("Hello"
;
And you'll get the right result. Ie, you can initialize a string object with a character array (which we already know).
But it doesn't work when you port this into the currency_impl.cc file. You put #include <string> into the file and then the rest, and the compiler throws an undeclared identifier error on the keyword string.
Does anyone have any ideas how to solve this, either by getting string functionality into currency_impl.cc, or do I have to write a string comparison routine to test character arrays?