I put together a small program and for the life of me I can't get sin to work properly. Been at it for 3 hours trying to get it done. Any help would be aprreciated.
Usually get the error:
error C2064: term does not evaluate to a function taking 1 arguments
I shortened everything to save room and make it easier to read.
#include <iostream>
#include <math.h>
using namespace std;
const double PI = 3.14159;
int main()
{
double VP;
double PA;
cout << "\nDetermine V of SV" << "\n" <<endl;
cout << "Enter The Peak of SV:" <<endl;
cin >> VP;
cout << "Enter Phase angle degrees:" <<endl;
cin >> PA;
double AIR;
AIR = PA /180 * PI;
double V;
double sin;
V = sin(AIR) * VP; //Probelm is in this line.
cout << "\nThe IV for SV with a PV of" << " " << VP << "\n"
<< " and a Phase Angle of " << " " << PA << " is "<< V << endl;
cout << "Press Enter to Continue." <<endl;
cin.ignore(2);
Nah, in my compiler all cmath does is disable the warning and include math.h...the problem is you are delcaring a double called "sin", when there is already a function called that. You also never use it...so just take it out and it should work.