I pine for the days when, as a C programmer, I could type:
memset( byte_array, '0xFF' );
and get a byte array filled with 'FF' characters. So, I have been looking for a replacement for this:
for (int i=0; i < byteArray.Length; i++)
{
byteArray[i] = 0xFF;
}
Lately, I have been using some of the new C# features and have been using this approach instead:
Array.ForEach<byte>(byteArray, b => b = 0xFF);
Granted, the second approach seems cleaner and is easier on the eye, but how does the performance compare to using the first approach? Am I introducing needless overhead by using Linq and generics?
Thanks, Dave