Re: LPCTSTR to std::string
- From: "Abdo Haji-Ali" <ahali@xxxxxxxxxxxxxxxxxxxxxxxxxxxx>
- Date: Sat, 30 Sep 2006 15:19:29 +0200
"Jacky Luk" <jl@xxxxxxxxxx> wrote in message
news:uT4bsfI5GHA.2536@xxxxxxxxxxxxxxxxxxxxxxx
HiIn this case it's not a "cast". It's an "assignment" or "copying"...
How to cast a LPCTSTR to std::string?
Do I justThis is the way to do it (it's called assignment)
m_fileName = lpszPathName;
orIf you try this one it would give a compiler error, because you can't "cast"
strcpy (m_fileName, lpszPathName);
an std:string to char* (only const char*)
orWhat do you mean by useful? Easier? Faster? Funnier :)
there is something more useful?
--
Abdo Haji-Ali
Programmer
In|Framez
.
- Follow-Ups:
- Re: LPCTSTR to std::string
- From: Jacky Luk
- Re: LPCTSTR to std::string
- References:
- LPCTSTR to std::string
- From: Jacky Luk
- LPCTSTR to std::string
- Prev by Date: Re: Debugging: obtaining symbol and line from address using .pdb file
- Next by Date: Re: convert int to LPTSTR
- Previous by thread: Re: LPCTSTR to std::string
- Next by thread: Re: LPCTSTR to std::string
- Index(es):
Relevant Pages
|