LPTSTR to int (c++)

Kamil Zadora picture Kamil Zadora · Feb 2, 2009 · Viewed 10.5k times · Source

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

I'm stuck at converting LPTSTR to int.

Thanks in advance.

Answer

Ates Goral picture Ates Goral · Feb 2, 2009

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