newbie

I have been given the task to try and understand a C++ program written by someone else....actually my job is to setup and test the hardware...in order to understand the parameters used in the setup....I need to look at a small program.

I see lines like this used alot

sp-> variable |= another variable

what is it doing....what does sp-> mean?

I told you I am new.

thanks
Brian
It is the same as:

(*sp).variable |= ...

Which means dereference sp and then get the member variable "variable".
sorry you will have explain it a lower level.

in my case sp is refering to a serial port number.



Say you have an object foo, and its type has a member named bar. You would access foo's bar by saying foo.bar. Now say you have a pointer p which points to foo. To access the same variable (could be a funtion as well) you say p->bar.
Topic archived. No new replies allowed.