// Collection of code snippets by Arne Vajhøj 
// (likely posted to comp.os.vms/INFO-VAX, INFO-TPU, MACRO32, eksperten.dk, newz.dk, LinkedIn or other place sometime between 1990 and now) 
#include <afxwin.h>

#include <iostream>

using namespace std;

int main()
{
   CStringArray sa;
   CString s = "test";
   sa.Add(s);
   CString s2 = sa[0];
   cout << (LPCTSTR)s << " " << (LPCTSTR)s2 << endl;
   char *p = s.GetBuffer(10);
   p[0] = 'x';
   s.ReleaseBuffer();
   cout << (LPCTSTR)s << " " << (LPCTSTR)s2 << endl;
   return 0;
}
