You are mixing up the "value of the pointer" versus the "value of what the pointer points to".
In your pass function, the declaration of
LPTSTR herp
is essentially
TCHAR *herp
. Inside the pass() function, a local value of the pointer is on the stack, the statement
herp = TEXT("blah blah blah");
stores a pointer to the string "blah blah blah" in the local copy of herp. The pointer (also named herp) in the main() function is not affected by this change and that's why you see the results you see.
If you really want to change the value of the pointer
herp
in the main code, you need to de-reference the pointer one more time.
*herp = TEXT("blah blah blah");
and this only changes value of the pointer, not the contents of the
TCHAR herp[1024] = "";
array of chars.
If you intent is to actually change the content of the buffer itself, then you have to copy the characters into the array with something like
strcpy(herp, TEXT("blah blah blah");
, in other words, use the incoming pointer to point to the destination of a string copy function.
Protecting against overflowing the buffer is an exercise for the student.