#string comparision

17 messages · Page 1 of 1 (latest)

hasty hatchBOT
#

When your question is answered use !solved to mark the question as resolved.

Remember to ask specific questions, provide necessary details, and reduce your question to its simplest form. For tips on how to ask a good question run !howto ask.

merry pollen
#

strcasecmp() is not a standard C function.
If case is important, should you not simply use strcmp()?

#

;compile

#include <string.h>

int main()
{
    static char* cmd = "get_time";
    return strcmp(cmd, "get_time");
}
willow rivetBOT
#
Compilation successful

No output.

merry pollen
#

Oh, I thought CE would tell me what the return code was. nvm.

woven badger
#

It returns non 0bwhen the str is found

#

So you shouldn't == 0

#

!= 0

merry pollen
woven badger
#

use strcmp

woven badger
#

Ok it does not work

#

what you want me to do about It when you just say it does not work?

#

read this please

woven badger
#

With this attitude you will never get help

#

Remember, it is you who is asking for help, and I do not have the duty to help you

hasty hatchBOT
#

@vital folio

Please Do Not Delete Posts!

Please don't delete forum posts. They can be helpful to refer to later and other members can learn from them. You can use !solved to close a post and mark it as solved.