Function not identified?

Creating a program that takes four values, converts them into slope value and then into a direction. When I try and assign the returning value into a variable "Answer" within main, my compiler says the identifier for my function is not found. Help?

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
#include <cmath>
#include <iostream>

using namespace std;


float Points_to_Degrees(float x1, float y1, float x2, float y2)
{
	// find slope of inputted points, convert to degrees (via formula above)
	// put points through if statements, return variable dir to main

	float dir = 0.0f;
	float var_slope = ( (y2 - y1) / (x2 - x1) ) * 45;

	if (x2 > x1 && y2 > y1)
		dir = var_slope + 0;
	if (x2 < x1 && y2 > y1)
		dir = var_slope + 90;
	if (x2 < x1 && y2 < y1)
		dir = var_slope + 180;
	if (x2 > x1 && y2 < y1)
		dir = var_slope + 270;

	return dir;


}



int main()
{
	float x1, y1, y2, x2;
	float Answer;
	Answer = Points_To_Degrees(x1, y1, x2, y2);
}
C++ is case sensitive.

You are calling Points_To_Degrees in main, but the function actually is named Points_to_Degrees (note the lowercase 't')
Last edited on
Thanks man. I've been having so many basic syntax errors lately. ;-)
Topic archived. No new replies allowed.