passing vector as a function

closed account (zhq4izwU)
I'm creating a function in which a vector is being passed.

In the .cpp file I have the following code
1
2
SignalChangedEvent(theSimulation.time + delay, outputWires[i], outputValue))
{}


In the .h file, so far I have the following code:
SignalChangedEvent(unsigned int, vector<Wire*>& , bool)

What bothers is me, is that I don't know how to finish the SignalChangedEvent part in the .h file. The vector<Wire*>& feels wrong, as the outputWires[i] vector has to be implemented. Where do I implement the 'i' component into the vector in the function declaration?
According to the function call it have to be declared as

/* some return tyoe */ SignalChangedEvent(unsigned int, Wire * , bool);

closed account (zhq4izwU)
Don't I have to worry about the 'i' in the outputWires[i] to call up a particular element of the vector?
When you will call the function you specify the required element of the vector.
Topic archived. No new replies allowed.