Error in my code
Run Time Check Failure #3 - T
I tried many times to fix it, but I failed. I added pointer to x, y, but "Run Time Check Failure #3 - T" — same error. Can you help me to fix this error?
#include<stdio.h>
#include<math.h>
typedef struct {
double x, y;
}location;
double dist(location a,location b)
{
return sqrt(pow(b.x - a.x, 2.0) + pow(b.y -a.y, 2.0));
}
void func(location l, location e)
{
double z;
location a = l;
location b = e;
printf("enter two dots:");
scanf("%lf %lf", a.x, a.y);
printf("enter two dots:");
scanf("%1",a, b);
printf("%.2lf", z);
}
void main()
{
location l;
location e;
func(l, e);
}