I rewrote the program since I lost track of what I was doing the first time, heres what i have now:
Code:
#include <stdio.h>
struct coord{
double x;
double y;
};
struct coord array[20];
int main ()
{
int index=0;
do
{
read_location( &array[index].x, &array[index].y);
index++;
}while(index < 5);
printf("%d", array[3].x);
return 0;
}
int read_location(double *x, double *y)
{
printf("Enter x:\n");
scanf("%lf", &x);
printf("Enter y:\n");
scanf("%lf", &y);
}
Now im thinking the issue is in the "read_location" function. Thanks for the help, its much appreciated