So I want use a 1d array to change the value of a 2d array if one of the values in the 2d array equal k. It doesn't seem to change it to a different value that it doesn't correspond too. How can I fix it?
1 2 3 4 5 6 7 8 9 10 11
for (int k = 1; k <= 255; k++)
{
for (int i = 0; i < height; i++) {
for (int j = 0; j < width; j++) {
if (pix[i][j] == k)
{
pix[i][j] = num[k-1];
}
}
}
}