Uhm, can someone show me an example of how an array is made for visited locations so we don't have to visit them again? like for example if i have 1 2 3 4 5 and i visited 1 and 2 and i wanna start at 3 , but doing that using an array that has the visited locations etc..
bool visited_location[5]; // create an array for keeping track of visiting some other array
for (int i = 0; i < 5; ++i)
{
visited_location[i] = false; // set all to false to begin
}
Each time you visit some element in whatever array you care about, set the corresponding element in visited_location to true.
When you want to know if you've visited already, look at the corresponding element in visited_location
Also, don't use arrays. Use std::vector or std::array.