View Single Post
  #3   Spotlight this post!  
Unread 19-01-2009, 23:13
neutrino15's Avatar
neutrino15 neutrino15 is offline
plɹoʍ ollǝɥ
AKA: Jordan Perr
FRC #0694 (Stuypulse)
 
Join Date: Feb 2007
Rookie Year: 2007
Location: New York City
Posts: 162
neutrino15 is just really niceneutrino15 is just really niceneutrino15 is just really niceneutrino15 is just really nice
Re: Potentiometer on cRIO, Programming in Windriver

You are correct, but made a really bad typo.. Declare a pointer like this
Code:
AnalogChannel  *turretPosition = new AnalogChannel(1) // declare a pointer to an Analog Channel and allocate a channel
You wrote that a new variable equals itself times a new analog channel.. Which makes no sense..

The distinction is this, the -> operator accessed a member of an object pointed to by your variable. The dot operator accesses a member of an actual object variable
Code:
ptr_to_object->Drive();
object.Drive();
Nothing in code is arbitrary. You just have to read up on the language.
Reply With Quote