1
General / Question regarding the creation of objects.
« on: August 03, 2015, 03:16:05 pm »
Hello everyone,
Why do you use:
and not
What's the different and why should you use one over the other?
I know the first variable is created on the stack and the second one is a pointer to an object on the heap?
Isn't the stack limited so won't it be a problem once you start using lots of variables?
Why do you use:
sf::Sprite sprite
and not
sf::Sprite* sprite
What's the different and why should you use one over the other?
I know the first variable is created on the stack and the second one is a pointer to an object on the heap?
Isn't the stack limited so won't it be a problem once you start using lots of variables?