Comparing 2 strings
#7

Quote:
Originally Posted by Aa12
Посмотреть сообщение
But doesnt "!" mean opposite value? If so, then if(!strcmp(...) would check if strings dont match? I could be wrong
strcmp gives 0 if strings match each other on given lengths and gives 1 or -1 if strings don't match each other.

In this case, you want them to match so you should get a "0", hence why you are using !strcmp.
Reply


Messages In This Thread
Comparing 2 strings - by Aa12 - 07.01.2016, 20:48
Re: Comparing 2 strings - by Darkwood17 - 07.01.2016, 21:00
Re: Comparing 2 strings - by saffierr - 07.01.2016, 21:16
Re: Comparing 2 strings - by Darkwood17 - 07.01.2016, 21:25
Re: Comparing 2 strings - by saffierr - 07.01.2016, 21:40
Re: Comparing 2 strings - by Aa12 - 08.01.2016, 08:31
Re: Comparing 2 strings - by Rufio - 08.01.2016, 08:50
Re: Comparing 2 strings - by Aa12 - 08.01.2016, 14:07
Re: Comparing 2 strings - by Aa12 - 08.01.2016, 17:20

Forum Jump:


Users browsing this thread: 3 Guest(s)