There's not a WPI library function for what you want, but there is a simple feature of the C language called an "assignment". It is implemented using the equals sign
= character.
Code:
variable = retrieve_value();
This takes the value returned by the
retrieve_value() function and assigns it to the variable named
variable. In order to make it work properly, the variable and the function must have the same type. (For joystick axis values, I think that type is
float.)
If you didn't already know this, you should probably find and follow a basic C/C++ programming tutorial. Finding and following a knowledgeable mentor would be a good idea as well.
[edit] I'm focusing on LabVIEW this season, so I'm not confident in my ability to give correct examples using the C++ classes to an insufficiently experienced programmer. Would someone else please answer specific questions about reading Joystick data? [/edit]