How to declare and compare the strings?
// test ="my test string";
char testDest[256];
char *p= _com_util::ConvertBSTRToString(URL->bstrVal);
strcpy(testDest, p);
How can I compare test with testDest?
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.
For non case sensitive comparisons try int
strcmp ( const char * str1, const char * str2 )http://www.cplusplus.com/reference/clibrary/cstring/strcmp/
If you want the string comparing to be case sensitive, i.e.
"test" != "TEsT", useint memcmp ( const void * ptr1, const void * ptr2, size_t num ).http://www.cplusplus.com/reference/clibrary/cstring/memcmp/
So:
EDIT: You can also use stricmp() for case sensitive comparisons.