Link to home
Start Free TrialLog in
Avatar of m-jansen
m-jansen

asked on

convert from string to LPCSTR

how to convert from string to LPCSTR?
SOLUTION
Avatar of ikework
ikework
Flag of Germany image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of sathisemail
sathisemail

You can look at the following link which provides a set of string conversion functions which include string to LPCSTR conversion as well.

http://www.codeproject.com/string/tconvert.asp

And these two pages gives you details about the different types of string and their conversions as well..

http://www.codeproject.com/string/cppstringguide1.asp
http://www.codeproject.com/string/cppstringguide2.asp

regards
Sathis
Avatar of m-jansen

ASKER

what do I have to include to use CString?

CString s = "abc";
LPCSTR a = s;
i have tried to #include <cstring> but that does not work
got it
#include "atlstr.h"
ASKER CERTIFIED SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial