have you tried syntax similar to this:
MyObject.bvec[n];
It should work as long as n is less than the size of bvec, which in the code provided would anything 0-9 inclusive.
Lerner
Nearly a Posting Maven
2,382 posts since Jul 2005
Reputation Points: 739
Solved Threads: 396
How about including public functions read() and write(). Both should take an int parameter. Then you can call MyObject.read(n) and MyObject.write(n). I don't see how you can overload [] to both read and write; how will compiler/user know whether you are trying to read or write if all you use is []?
Lerner
Nearly a Posting Maven
2,382 posts since Jul 2005
Reputation Points: 739
Solved Threads: 396
I seem to recall something about using a proxy , but I don't remember enough of it to do much more than mention it and some quick & dirty search .
Dave Sinkula
long time no c
5,058 posts since Apr 2004
Reputation Points: 2,780
Solved Threads: 314