Answer the question
In order to leave comments, you need to log in
Two-dimensional array in a structure, how to use it correctly?
I can not understand.
The code is like this. Our function should return 3 arrays. To implement this, I decided to use structures.
struct hsv{
double h_buf;
double s_buf;
double v_buf;
};
hsv rgb2hsv(struct hsv img, unsigned char y, unsigned char x){
//Размеры массивов мы получаем в функции
img.h_buf[y][x];
img.s_buf[y][x];
img.v_buf[y][x];
for(int i = 0; i < x; i++)
for(int j=0; j < y; j++)
{
img.h_buf[j][i] = 1;
img.s_buf[j][i] = 1;
img.v_buf[j][i] = 1;
}
return img;
}
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question