Thread: C++ Help
View Single Post
  #3  
Old 05-18-2003, 02:44 PM
Marco_Wrc Marco_Wrc is offline
Rally Fan
 
Join Date: Jan 2002
Posts: 593
Thanks: 0
Thanked 0 Times in 0 Posts
Ok, normally I don't dive into other's code, but I did this time.

You call the function Torque:
Torque(Engine_Speed, Throttle);

Then you want output from that function:
cout << Torque;

But, that doesn't work because:
The function torque returns a double. You need to print that double, not print the function Torque.

So, to fix it you can assign the double to a variable:
double torq = Torque(Engine_Speed, Throttle);
cout << torq;

Or print the output from Torque directly:
cout << Torque(Engine_Speed, Throttle);

If you do it the way you do: cout << Torque; You'll print out the memory address of the function Torque.
Reply With Quote