I am new to C++. I am working in computer vision and I have a potential problem creating the arrays.
I have a loop, from which I am getting a value of the variable (e.g. depth of the specific point on the segmented point-cloud). By this loop, I am getting individual values of this clusters dynamically.
Now I want to store these values in one array.
my code currently saving the value of the variable in 15 elements of array. e.g. z = {1.3, 0, 0, 0, 0, 0, ..} while I want to save after each segmentation, the obtained values to be added to only one array e.g. z = {2.3, 4.5, 2.3, 6.5, 3.5, ..}
code snippet:
double z = centroid [2];
double array[15] = {z};
for (int i=0; i<15; i++)
{
std::cout << array[i] << std::endl;
}
could you please help.
Regards, Herry.