Code tags. And don't add the numbers. The code tags will do that:
[code=cplusplus]
// paste your code here
[/code]
int circle_x, circle_y, circle_radius, square_x, square_y;
int x_y_square_coordinates(int circle_x, int circle_y, int circle_radius, int& square_x, int& square_y)
{
square_x = circle_x-circle_radius;
square_y = circle_y-circle_radius;
return square_x, square_y;
}
int main()
{
cout << "Enter the x and y coordinates of the center of the circle and the radius of the circle." << endl;
cout << "x:";
cin >> circle_x;
cout << "y:";
cin >> circle_y;
cout << "radius:";
cin >> circle_radius;
cout << x_y_square_coordinates(circle_x, circle_y, circle_radius, square_x, square_y);
cin.get();
getchar();
return 0;
}
You can't return two integers from a function that returns one integer. You either need to create a struct or array that contains both integers you want to return and have the function return that, or pass one or both integers by reference, then change them inside the function (looks like you've already done that in your function, though passing a global variable by reference is redundant).
In YOUR case, you don't have to do either, since you made both square_x and square_y global. You don't need to return anything from your function. You can just make it a void function. You still have the confusion of passing a global variable by reference, which is legal, but generally not done. You probably don't need all of these variables and can delete some of them, or at least not pass them.