Quantcast
Channel: Compare 2 byte arrays - Stack Overflow
Browsing latest articles
Browse All 5 View Live

Answer by PTwr for Compare 2 byte arrays

"Is there a way to do data1-data2 = data3 without enumerating through a loop?" No. It is technically impossible.At best, or rather worst, you can call function that will do enumeration for you. But it...

View Article


Answer by Tim Schmelter for Compare 2 byte arrays

Here is another (less readable but maybe a little bit more efficient) approach that does not need LINQ:public static int[] GetDifference(int[] first, int[] second){ int commonLength =...

View Article


Answer by Giannis Paraskevopoulos for Compare 2 byte arrays

var data3 = data1.Select((x,i)=>new {x,i}) .Join ( data2.Select((x,i)=>new {x,i}), x=>x.i, x=>x.i, (d1,d2)=>Math.Abs(d1.x-d2.x) ) .ToArray();

View Article

Answer by Selman Genç for Compare 2 byte arrays

You are looking for Zip methodvar data3 = data1.Zip(data2, (d1,d2) => Math.Abs(d1 - d2)).ToArray();Enumerable.Zip<TFirst, TSecond, TResult> MethodApplies a specified function to the...

View Article

Compare 2 byte arrays

I have 2 int arrays.int[] data1 #int[] data2 #I want to create a 3rd int[] data3 which is the differences between the 2 other arrays.Let us take the 1st value in data1.The value is 15 (e.g.).Now let us...

View Article

Browsing latest articles
Browse All 5 View Live


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>