How to do the transform bstr_t to double in c++?
I was thinking to convert to *char, then *char to double?
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.
If you have a
char*orwchar_t*string, use thestrtod/wcstodfunctions to read a double.E.g. using @Steve’s suggestion:
Apparently
_bstr_thas implicit conversion operators both toconst char *andconst wchar_t*, so you can use them directly in the float parsing functions.