Someone please help me with arrays!

I cannot get my head around arrays at all, ive tried and tried and nothing i try works. I need to let a user enter 10 RGB values that are stored in arrays and then the user can select one of them to change the colour of something. I have tried for days to get it to work and I just cant do it, please someone give me an idea of how to do it :( :(

Ive tried this :

int c0[3];

if (inp == 'k')
{
for (i=0; i<2; i++)
{
do {
win.clear();
win << "Please Enter The Red Value: ";
win >> c0[i];
win << "Please Enter The Green Value: ";
win >> c0[i];
win << "Please Enter The Blue Value: ";
win >> c0[i];
win << "Add another colour? Y/N?: ";
win >> cont;
win.clear();
} while (cont == 'y' || i<2);
}
}

it doesnt work. this is in the main and im using a special library which is why it says win
Example:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
#include <iostream>
#include <string>

    using namespace std;

int main()
{
    string label[3] = { "Red", "Green", "Blue" };
    int c0[3];

    for (int i=0; i<3; i++)
    {
        cout << "Please Enter The " << label[i] << " Value: ";
        cin  >> c0[i];
    }

    cout << "\nThese are the values:\n";
    for (int i=0; i<3; i++)
    {
        cout << c0[i] << endl;
    }

    return 0;
}


Output:
Please Enter The Red Value: 123
Please Enter The Green Value: 456
Please Enter The Blue Value: 987

These are the values:
123
456
987
Topic archived. No new replies allowed.