Path: csiph.com!eternal-september.org!feeder.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail From: Keith Thompson Newsgroups: comp.lang.c Subject: Re: standard error codes Date: Thu, 12 Jan 2017 12:10:25 -0800 Organization: None to speak of Lines: 31 Message-ID: References: <96e16709-18eb-4399-86c4-a6f30a767df3@googlegroups.com> <86260b21-0fa2-42b4-93c6-08e9241d4c17@googlegroups.com> <64011b84-2f8d-44f2-902a-0eacfcdf630b@googlegroups.com> <11823fb6-613e-4283-95e8-dd930e152418@googlegroups.com> <546841f1-b478-44dc-abc0-22ca4f46e553@googlegroups.com> <87o9zdtgzo.fsf@gmail.com> <5877d9e5.1558312@news.xs4all.nl> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Injection-Info: mx02.eternal-september.org; posting-host="768745921b79448f5a531b86aeb60d71"; logging-data="31379"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+ZsCY3PZcASqisExtROhwd" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1 (gnu/linux) Cancel-Lock: sha1:KIJdTHK9WrPsWBq7v5u8843cbvI= sha1:UDr0sJxqvT3gN6DfAFuNGKYw53g= Xref: csiph.com comp.lang.c:101548 raltbos@xs4all.nl (Richard Bos) writes: > Gareth Owen wrote: >> BartC writes: >> > It just reinforces my point that strcmp by itself is unintuitive. >> >> Matlab has a boatload of functions that shares names with functions in >> the C library. Almost without exception (no pun intended) they function >> in an identical manner (modulo a completely different notion of error >> handling). >> >> The exception is strcmp() which returns 1 if the two arguments are the >> same, and 0 if not. > > So what you're saying is, Matlab is incapable of telling you whether a > string comes before or after another string? Well, there goes the sorted > list... Quoting https://www.mathworks.com/help/matlab/ref/strcmp.html : With string arrays, you can use relational operators (==, ~=, <, >, <=, >=) instead of strcmp. You can compare and sort string arrays just as you can with numeric arrays. I don't now how Matlab deals with strings and arrays, but I presume this gives you the ability to do something like C's strcmp(). -- Keith Thompson (The_Other_Keith) kst-u@mib.org Working, but not speaking, for JetHead Development, Inc. "We must do something. This is something. Therefore, we must do this." -- Antony Jay and Jonathan Lynn, "Yes Minister"