> How do i access the data
What data?
int x1,x2,y1,y2. double m,d. E.x. what would i have to write to display those integers and doubles
> How do i declare it.
Declare what?
the variables, in main, my compiler keeps telling me they are not declared in the scope.
Thank you for replying to my question.
In function 'int main()':
29:4: error: 'd' was not declared in this scope
29:18: error: 'x2' was not declared in this scope
29:21: error: 'x1' was not declared in this scope
29:36: error: 'y2' was not declared in this scope
34:9: error: 'y2' was not declared in this scope
38:26: error: 'x2' was not declared in this scope
38:30: error: 'x1' was not declared in this scope
I will start at the top struct data works better as struct Data notice the capital D. Not sure why it made a difference, but it did.
Then in your forward declarations void distance (double ptr ); you need to say that you are sending a pointer of type Data void distance (Data *ptr );.
Lines 27 to 41 are actually 2 functions that need to be defined after main, then at line 27 or 28 call the functions when needed.
In line 29 you did not declare d with a data type as you did with m in line 38.
Lastly in what should be separate functions x1, y1,x2, y2 are not declared, but are part of the struct so you need refer to the struct with pointer notation ptr->x1 etc.
@Handy Andy
Thank you SO MUCH, big help.Thank you for your time.
Though I do not know why, my professor says it should be able to compute (1/3,-3) and (2, -1/4) but the second I put in the first two points the program goes crazy. any advice.