954,492 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

Please help me with strange error

(Im using VS C++ EE 2008)

Hi people, i have had a strange problem today. Im currently programming something to do with Physics. I have searched the Internet already for the answer, including this site. The problem is:
error C2064: term does not evaluate to a function taking 1 arguments

For the other topics i saw this in, it seemed to be that they had a variable with the same name as a function or similar, and they all were with user-defined functions.

My problem is slightly different, the functions I am trying to use are predefined. (Trignometry functions: cos and sin) I have checked the variables, and i have not used any with the same name. Here's the code:

double accelerate(double t_a,double t_f)
{
	return -9.8(sin(t_a) + (t_f * cos(t_a)));
}


Thats where the error occurs, includes:

#include <iostream>
#include <windows.h>

#include <math.h>

#include "physics.h"

using namespace std;


Only use (so far) of function:

double angle = atan2(track[(int)position].e_height-track[(int)position].s_height,1);
cout << "\nAngle: " << radtodeg(angle);
// Now, work out acceleration and it's direction
acceleration = accelerate(angle,0.06);
speed += acceleration / 33;
position += speed / 33;


(I have no where near finished this, but i cannot continue to i can get this working)

Thanks for any help, and sorry if i missed something, or there is another post about this, i didn't see it! :DEDIT: So sorry, very stupid mistake on my part :P I was using 9.8( as you would in math, instead of 9.8 * (

Sorry for your time :D

inegames
Newbie Poster
1 post since May 2009
Reputation Points: 10
Solved Threads: 0
 

Why do you use old-style header for the math library?
#include <math.h>
in C++, the new-style headers are preferred: #include <cmath>
:P

tux4life
Nearly a Posting Maven
2,350 posts since Feb 2009
Reputation Points: 2,134
Solved Threads: 243
 

This question has already been solved

Post: Markdown Syntax: Formatting Help
You