What is the function of the '->' in that line?

  • Thread starter Thread starter NCEE
  • Start date Start date
  • Tags Tags
    Function Line
Join the discussion
Registration is free. Start your own thread to ask a follow-up.
1 reply · 3K views
NCEE
Messages
4
Reaction score
0
I was going through a bit of open source code when I came upon this line
"pTerm = pid->pGain * error;"

What is the function of the '->' in that line?
 
Engineering news on Phys.org
pid is a pointer to a class or structure.
pGain is a member of the class or structure.
pid -> pGain means the same as (*pid).pGain (but it looks prettier).