I have a function that prints out 11 points of a quadratic function ax^2 + bx + c with a, b, c as input. The function works fine except I need to use structures, not just variables x and y. How can I get my function to return a structure value and store it in a structure array then print out the structure array?
struct point {
int x;
int y;
};
struct point *findpoint(int a, int b, int c){
int i, x, y;
x = -5;
for (i = 0; i < 11; i++)
{
y = (a * (x * x)+ (b * x) + c);
printf("The points are {%d, %d}\n", x, y);
x++;
}
}
struct point arr_point[11];
int main(int argc, char *argv[]){
struct point *ptr;
printf("Enter coefficients a, b, c:");
int a, b, c;
int i;
for (i = 0; i < argc; i++){
scanf("%d %d %d", &a, &b, &c);
}
printf("%d %d %d\n", a, b, c);
findpoint(a, b, c);
return 0;
}