Recently, i have created a simple Java Servlet server which could parse a request xml from the HTTP POST Request and then return the HTTP Response together with the response xml. In the server implementation, i need to convert an InputStream into a String. The following code shows you how to make it.
「對阿明來講,香港其實就是李嘉誠,是李家的城,The City Of the Lee’s Family。他的口頭禪就是還差一個字,差一個什麼字呢?香港特別行政區,HKSAR,Hong Kong Special Administrative Region……但是大家想像下,這個HKSAR,如果H,可以變成L,會變成什麼?LKS!Lee Ka Shing Administrative Region!」
The following code shows you how to print CString to cout.
#include "atlstr.h"
#include <iostream>
using namespace std;
int main ()
{
// Create a CString
CString cStr = _T("I am a CString.");
// Print the address of cStr only
cout << cStr << endl;
// Print the cStr content
wcout << cStr.GetString() << endl;
// Pause
system("PAUSE");
// Terminate the program:
return 0;
}