// 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 <stdio.h>

#include <windows.h>
#include <tchar.h>
#include <crtdbg.h>
#include <atlconv.h>

void dummy(LPCTSTR s)
{
    _tprintf("%s\n",s);
}

int main()
{
    // the easy way
    LPCTSTR s1 = _T("ABC123");
    dummy(s1);
    // the workaround using ATL
    char s2[10];
    sprintf(s2,"ABC%d",123);
    dummy(A2T(s2));
    // the rigth way
    TCHAR s3[10];
    _stprintf(s3,_T("ABC%d"),123);
    dummy(s3);
    return 0;
}
