Dismiss Notice
Join Physics Forums Today!
The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

Help with code

  1. Nov 29, 2006 #1
    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?
     
  2. jcsd
  3. Nov 29, 2006 #2

    AlephZero

    User Avatar
    Science Advisor
    Homework Helper

    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).
     
Know someone interested in this topic? Share this thread via Reddit, Google+, Twitter, or Facebook

Have something to add?