[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Strcmp not behaving as expected
From: |
Mumble07 |
Subject: |
Strcmp not behaving as expected |
Date: |
Sun, 21 Oct 2012 08:10:18 -0700 (PDT) |
I'm writing a fairly simple plotting function in Octave with a number of
filenames, and I have a number of string comparison commands to sort the
datasets. The problem is, the program kept behaving oddly, and after some
investigation, it seems that strcmp was the culprit and is acting completely
randomly with respect to the documentation.
Examples:
strcmp ('vent', 'vent')
returns
error: A(J,I): row index out of bounds; value 118 out of bound 114
and
strcmp ('g_90', 'vent')
returns a 4x4 unit matrix.
meanwhile
strcmp ('g_90', 'nograv')
returns a 4x6 matrix with 1's in the first and last columns and 0's
everywhere else.
I have a few other examples, but in general, strcmp is not reliably
comparing strings.
--
View this message in context:
http://octave.1599824.n4.nabble.com/Strcmp-not-behaving-as-expected-tp4645565.html
Sent from the Octave - General mailing list archive at Nabble.com.
- Strcmp not behaving as expected,
Mumble07 <=
- Re: Strcmp not behaving as expected, Ben Abbott, 2012/10/21
- Re: Strcmp not behaving as expected, Mumble07, 2012/10/22
- Re: Strcmp not behaving as expected, c., 2012/10/22
- Re: Strcmp not behaving as expected, Martin Helm, 2012/10/22
- Re: Strcmp not behaving as expected, Mumble07, 2012/10/22
- Re: Strcmp not behaving as expected, Martin Helm, 2012/10/22
- Re: Strcmp not behaving as expected, Mumble07, 2012/10/22
- Re: Strcmp not behaving as expected, Mumble07, 2012/10/22
- Re: Strcmp not behaving as expected, Jordi GutiƩrrez Hermoso, 2012/10/22
- Re: Strcmp not behaving as expected, Martin Helm, 2012/10/22