c++castinglptstr

LPTSTR to int (c++)


I'm passing some numeric arguments while creating a process (in VC++)

I'm stuck at converting LPTSTR to int.

Thanks in advance.


Solution

  • A LPTSTR is just a Long Pointer to a char or wide-char string.

    Use _ttoi or _tstoi for a character-width-agnostic way of doing the conversion.

    Also see