compare a large number of variables



Hi,

I wonder if there is a nice bit twiddling hack to compare a large
number of variables?

If you first store them in an array, you can do:

for (i = 0; i < n; i++) {
if (array[i] != value) {
/* array[i] differs from value, do something*/
}
}

but I dont have the variables in an array, and would like to figure out
a nice oneliner.

best regards.
E.

.



Relevant Pages

  • Re: PHP - I give up.
    ... /* Compares A and B, given auxiliary data AUX, and returns a ... typedef int algo_predicate_func (const void *data, ... SIZE bytes each, using COMPARE for comparisons. ... first element in ARRAY that matches TARGET, ...
    (comp.programming)
  • Re: working with byte arrays
    ... array before the values are assigned. ... Before I allways thought that ALL bytearray operations require a redim, ... >> If you know a better way to compare two byte arrays then please let me ... > Public Sub ShareMemoryViaArray(ByVal ArrayPtr As Long, ...
    (microsoft.public.vb.general.discussion)
  • Re: An inefficiency in Array.Sort
    ... use a temporary array, and Array.Sort is an in-place sort. ... they repeatedly compare ato a. ... former really makes no sense at all, especially presuming a QuickSort ... It is possible that the sort algorithm loses track of the original array ...
    (microsoft.public.dotnet.languages.vb)
  • Re: Array comparison
    ... pointers are only going to compare their object pointers ... pointers and not the contents of the strings. ... things like array of Char, bytes, words, dword, int64's etc.. ...
    (alt.comp.lang.borland-delphi)
  • Re: [PHP] Selecting Rows Based on Row Values Being in Array
    ... Please excuse the ignorance, I'm a newbie, but I'm only use to simple ... I'm asking because I don't know where we're telling the code to compare the ... Selecting Rows Based on Row Values Being in Array ... create one string from them, then it will compare each string in the ...
    (php.general)