When i try to convert pointer to pointer i get error: expression must be an lvalue or a function designator
Here is my code:
sf::RenderWindow** window = &game->getWindow(); //expression must be an lvalue or a function designator
window->create(sf::VideoMode(1600, 800), game->getName(), sf::Style::Default, window_settings); //expression must be an lvalue or a function designator
int get_int(){
return 0;
}
int *get_pointer(){
staticint x = 0;
return &x;
}
int &get_reference(){
staticint x = 0;
return x;
}
&get_int(); //Error. Returned int is temporary.
&get_pointer(); //Error. Returned pointer is temporary.
&get_reference(); //OK. References are not temporaries.
You can only get the address of something that can appear on the left side of an assignment.