Here's my code:
if (native_units == "PSI")
native_units is a pointer to a string, and I've included it the string class "string.h", but the statement doesn't work as intended. Whats the right way to code this?
Thanks,
-Ken
This thread has been locked.
If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.
Here's my code:
if (native_units == "PSI")
native_units is a pointer to a string, and I've included it the string class "string.h", but the statement doesn't work as intended. Whats the right way to code this?
Thanks,
-Ken
Ken,
If you are using C, you need to use strcmp(). Check: http://www.cplusplus.com/reference/clibrary/cstring/strcmp/
Cheers,
Rafael