Need a bit of help with pointers
Code:
int main()
{
int form;
int x1,x2,y1,y2;
double m,b;
if(get_problem(form)==1) //if get_problem return value is 1
{
get2_pt(&x1,&x2,&y1,&y2); //call the next function
display2_pt(&x1,&x2,&y1,&y2);
}
return 0;
}
int get_problem(int form)
{
printf("Select the form that you like to convert to slope-intercept form:\n1 ) Two-point form (you know two points on the line)\n2) Point-slope form (you know the line's slope and one point)\n=> ");
scanf("%d",&form);
return form; //user either enters 1 or 2
}
void get2_pt(int *x1,int *x2, int *y1,int *y2) //potential problem source
{
printf("Enter the x-y coordinates of the first point seperated by a space=> ");
scanf("%d %d",&x1,&y1);
printf("Enter the x-y coordinates of the second point seperated by a space=> ");
void display2_pt(int *x1, int *x2, int *y1, int *y2)
{
printf("Two-point form\n");
printf("%d%d",x2,x1); //instead of printing out the value, it prints out the address.
}
My question is. Where did i go wrong? Print only prints only the addresses of the variable, and not the value