#include
#include
#include
#include
#include
Using namespace std;
USING NAMESPACE BOOST;
Int main (void)
Try {
// The following is a solution for built-in type to String conversion
// Lexical_cast advantage is obvious
INT IVAL;
CHAR CVAL;
Ostringstream out_string;
String str0;
String str1;
IVAL = 100;
CVAL = 'w';
OUT_STRING << ival << "<< CVAL;
STR0 = OUT_STRING.STR ();
Str1 = lexical_cast
Lexical_cast
COUT << str0 << endl;
COUT << str1 << endl;
// The following is a String solution to a built-in type conversion
// It is still inadequate compared to Stringstrem.
// I don't know what idea you have>?
Int itmpe;
CHAR CTMPE;
STR0 = "100K";
STR1 = "100H";
IstringStream in_string (str0);
IN_STRING >> ITMPE >> CTMPE;
Cout << itmpe << "<< CTMPE << endl;
ITMPE = Lexical_cast
CTMPE = lexical_cast
System ("pause");
Return 0;
}
Catch (Bad_Lexical_cast E)
{
Cout << E.WHAT () << endl;
cin.get ();
}