char array to LPCTSTR conversion in c

前端 未结 8 873

Does anyone know how to convert a char array to a LPCTSTR in c?

Edit:

For more reference, I need to add an integer to a string then convert that string to LP

8条回答
  •  南笙
    南笙 (楼主)
    2021-01-02 03:28

    "Does anyone know how to convert a char array to a LPCSTR in c?"

    You don't have to do anything at all. It automatically converts to that type (except in initializers and sizeof).

    "CreateFile(portName..."

    Perhaps you should tell us the error message that VC++ gives you at compile time?

    Perhaps you should also tell us what error message VC++ gave you when Adam Rosenfield's whcar_t version didn't work for you?

提交回复
热议问题