//: C05:StringConvTest.cpp // From "Thinking in C++, Volume 2", by Bruce Eckel & Chuck Allison. // (c) 1995-2004 MindView, Inc. All Rights Reserved. // See source code use permissions stated in the file 'License.txt', // distributed with the code package available at www.MindView.net. #include #include #include "StringConv.h" using namespace std; int main() { int i = 1234; cout << "i == \"" << toString(i) << "\"" << endl; float x = 567.89; cout << "x == \"" << toString(x) << "\"" << endl; complex c(1.0, 2.0); cout << "c == \"" << toString(c) << "\"" << endl; cout << endl; i = fromString(string("1234")); cout << "i == " << i << endl; x = fromString(string("567.89")); cout << "x == " << x << endl; c = fromString >(string("(1.0,2.0)")); cout << "c == " << c << endl; } ///:~