I've got this program where I'm creating a character array that's filed with a given character, and I was wondering if there is a faster way to do so than the nested for loops that I've been using, like the numpy.zeros command in python. Like for an array arr,
char[,] arr = new char array[3, 4]
Is there a faster way to fill it than:
for (int i=0; i<3; i++)
{
for (int j=0; j<4; j++)
{
arr[i, k] = 'a';
}
}
question from:https://stackoverflow.com/questions/66050333/fill-a-c-sharp-2d-array-with-some-value