See this is the simple program definition that’s you can refer for STD::string.
Code:
#include <afx.h>
#include <iostream>
int main()
{
CString P("welcome to visual C++");
std::cout << P.GetBuffer(0) << std::endl;
return 0;
}
And other one is for cstring you can refer both of these
Code:
#include <atlstr.h>
#include <iostream>
int main ()
{
CString strtesting (_T("This is using the CString “));
#ifdef UNICODE
std::wcout << (LPCTSTR)strTesting;
#else
std::cout << (LPCTSTR)strTesting;
#endif
return 0;
}
Bookmarks