Text color and address swapping C++

I have an assignment which I am struggling to finish as I am new to C++. The assignment is asking to do the follow. (I already have the menu, but can't put everything together)
 Before showing the menu will ask to input array size. it saves then show the menu.
1.Display array addresses
2.Change array location
3.exit

The number 2 change location like this
If I entered 5 as array size it should show this:

[0] = 0x7fff5fbff880
[1] = 0x7fff5fbff884
[2] = 0x7fff5fbff888
[3] = 0x7fff5fbff88c
[4] = 0x7fff5fbff890
2.change array location.
Input the first number: 3
Input the second number: 4

 After changing:
[0] = 0x7fff5fbff880
[1] = 0x7fff5fbff884
[2] = 0x7fff5fbff888
[4] = 0x7fff5fbff890
[3] = 0x7fff5fbff88c

My question is, how can I swap the pointers with two values like the example output above and have random colored output (every line with different text color) so when I swap the pointers the result will be noticeable.. It should have the main.cpp and color.cpp class. Any help will be appreciated. Any help will be appreciated.

My array size code. 

#include <iostream>
#include <windows.h>
using namespace std;

int main()
{
    float ptr[5];
    int inn;


    cout<<"Input array size: "<< endl;
    cin >> inn;


   for (int i = 0; i < inn; ++i) 
               
          {
              cout  << "[" << i << "] = "<< ptr + i << endl;
              
          }

    cin.get(); // wait
    return 0;
}

There this code example for changing location, I'm not sure
 

void Kart::changesembol(int a, int b, Kart semboldizi[])
{
    Kart temp;
    temp = semboldizi[a - 1];
    semboldizi[a - 1] = semboldizi[b - 1];
    semboldizi[b - 1] = temp;
}

Author: UCN
Login to Answer
Sort By:
Oldest
|
Newest
|
Vote
|
My Answer