I have a C++ string. I need to pass this string to a function accepting a char* parameter (for example – strchr()).
a) How do I get that pointer?
b) Is there some function equivalent to strschr() that works for C++ strings?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Cstring equivalent ofthe
C++stringobject usec_strfunction.
charin astringobject usefind_first_offunction.Example:
Note: I gave the
strlenjust an example of a function that takeschar*.