Properly get string
#10

In an if-statement, !variable means "variable == 0". Strcmp returns 0 when the strings match, so !strcmp means match. When you say if(variable), it actually means if(variable != 0), so "if( strcmp(string1, string2) )" is true when string1 and string2 do NOT match.
Reply


Messages In This Thread
Properly get string - by mads232 - 01.03.2015, 19:14
Re: Properly get string - by Vince - 01.03.2015, 19:15
Re: Properly get string - by mads232 - 01.03.2015, 19:17
Re: Properly get string - by ArchB42 - 01.03.2015, 20:02
Re: Properly get string - by mads232 - 01.03.2015, 20:28
Re: Properly get string - by HazardouS - 01.03.2015, 20:34
Re: Properly get string - by mads232 - 01.03.2015, 20:36
Re: Properly get string - by CalvinC - 01.03.2015, 20:37
Re: Properly get string - by mads232 - 01.03.2015, 20:40
Re: Properly get string - by HazardouS - 01.03.2015, 20:44

Forum Jump:


Users browsing this thread: 1 Guest(s)