Quote:
Originally Posted by sircedric4
We ran into this exact same problem yesterday and after searching online for an hour and getting nowhere on the cocanate issue i finally found this link which was immensely helpful.
http://www.cppreference.com/wiki/c/io/printf
Like the poster above me showed, I kept finding convoluted methods to do something that is extremely trivial in other program languages. After evaluating the DriverStationLCD class and seeing it was probably inheriting most of its features from the C++ printf class I figured I would give the %f thing in the link above a try. When we tried it this evening it worked perfect.
Your code might look like this as an example:
dsLCD->Printf(DriverStationLCD::kUser_Line4, 1,"Joystick Y axis: %f", driveController->GetY());
The %f is a placeholder waiting for a float variable to be passed. Hope this helps you out.
|
printf isn't a class! printf is a function! Also other programming languages (I assume you mean Java, C#, VB, etc) probably use printf or at least a function similar to the one C uses. In fact, float to string is trivial.