when I do this (in my class)
public:
Entity()
{
re_sprite_eyes = new sf::Sprite();
re_sprite_hair = new sf::Sprite();
re_spri
Another thing that may call your attention is the line:
int * p1, * p2;This declares the two pointers used in the previous example. But notice that there is an asterisk (
*) for each pointer, in order for both to have typeint*(pointer to int). This is required due to the precedence rules. Note that if, instead, the code was:int * p1, p2;
p1would indeed be of typeint*, butp2would be of typeint. Spaces do not matter at all for this purpose. But anyway, simply remembering to put one asterisk per pointer is enough for most pointer users interested in declaring multiple pointers per statement. Or even better: use a different statemet for each variable.
From http://www.cplusplus.com/doc/tutorial/pointers/