I have a 3D array and I need to find a int in that array using a single int.
My array:
int arrayOne[3][3] = {
{1,2,3},
{4,5,6},
{7,8,9}
};
I need to be able to navigate the array using a single int like:
int i = 4;
cout << arrayOne[4];
This will print out 5.
It it possible to do it like this or is it another way to do this?
I started to code with a 3D array and I really don't want to rewrite everything if I don't need to.
I have googled around and did not find a solution.