Array help

Hey guys, I feel like I'm missing a simple concept. How do I use

Struct * bam[10]

in the add function? Do I really have to pass it through as an argument? Is there any way to use it without having pass it through as an argument?
(NOTE: Finish is a class as well, set up similar to Start. The following works fine now and returns the expected output)

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
class Start{

    int num, jar;

struct Struct{     ///Trying to make this struct
    Finish low;     ///work with 'Finish' type variables
    Finish high;    ///
    Struct (Finish l, Finish h);

};


public:

    Start (int,int);

    Struct * bam[10];


    void add(Finish k)
    {

        int answer = k.getA() + k.getB();

        cout << answer <<endl<<endl;
    }

};
Both bam and add are non-static members of the same class so you can use bam from add without doing anything special.
I'm not sure I follow. Like this:

1
2
3
4
5
6
7
8
9
    void add(Finish k)
    {
        bam[0].low = 5;///<-------------here?
        bam[0].high = k.getA();///<--or here?

        int answer = k.getA() + k.getB();

        cout << answer <<endl<<endl;
    }
Topic archived. No new replies allowed.