- Stackoverflow - a fascist web-site. - 1 Update
- Comparing strings with if else - 1 Update
Vlad from Moscow <vlad.moscow@mail.ru>: Nov 08 02:24PM -0800 On Sunday, November 8, 2015 at 9:00:42 PM UTC+3, Rosario19 wrote: > else printf("Wrong. \n"); > return 0; > } No I did not try the code.:) With expressions you may use either sizeof( key ) or sizeof key. |
Ben Bacarisse <ben.usenet@bsb.me.uk>: Nov 08 09:27PM > { return > *s ?( *s1 ? *s == *s1 && isequal( s + 1, s1 + 1 ): 0 ): > *s1 ? 0 : 1; } I think return *s == *s1 && (*s == 0 || isequal(s + 1, s1 + 1)); is a bit clearer (odd indentation aside). And it probably counts as tail recursive for some compilers. <snip> -- Ben. |
You received this digest because you're subscribed to updates for this group. You can change your settings on the group membership page. To unsubscribe from this group and stop receiving emails from it send an email to comp.lang.c+++unsubscribe@googlegroups.com. |
No comments:
Post a Comment