newing up the return of a function.

In SFML sf::Shape::Circle returns a sf::Shape.

Here's the line of code giving me an error:

sf::Drawable* cl = new sf::Shape::Circle(0, 0, 10, bColor, 1, fColor);

These are the errors it gives me:

error: expected type-specifier
error: cannot convert 'int*' to 'sf::Drawable*' in initialization
error: expected ',' or ';'


I think I'm missing something very fundamental here.
Last edited on
Circle is a function that returns a Shape. The argument of new has to be a type. You could do
sf::Drawable* c1 = new sf::Shape(sf::Shape::Circle(...));
Oh ok, I'll have to remember that, thanks.
Topic archived. No new replies allowed.