#includeint main() { sf::FloatRect rect(10, 10, 50, 50); float max_y = rect.top + rect.height; std::cout << "Max Y-coordinate: " << max_y << std::endl; return 0; }
#includeIn this example, the maxY function is called directly on the FloatRect object. The result is stored in a variable and printed to the console.int main() { sf::FloatRect rect(20, 30, 60, 70); float max_y = rect.maxY(); std::cout << "Max Y-coordinate: " << max_y << std::endl; return 0; }