Help with operator overloading!

Hey guys/girls,

I've got an assignment working with an encoder and a quadrature decoder/counter card - the thing I need a hand with is I'm required to overload the '!' operator such that when I write: '!MyEncoder', it resets all channels (there are 8).

I have a class with all required functions, such as ReadChannel(int channel) and ResetChannel(int channel), I'm just not exactly sure how I'd create the overload operator member function.

It doesn't need to return any value, it simply needs to perform a function (ie reset all channels) when '!MyEncoder' is input. I think that it requires an argument (int channel) which perhaps loops through all channels and resets them like that. I'm just confused as to how I would modify the functionality of '!'.

Any help/guidance is MUCH appreciated :)

(ps, if you would like to see the source code, if that'll help, ill upload it)
Last edited on
Topic archived. No new replies allowed.