Jump to content
Posted 20 January 2012 - 04:21 PM
Posted 20 January 2012 - 04:25 PM
Posted 20 January 2012 - 04:44 PM
Pointer allow you to change the value?
What makes you think that pointers disallow writing to a value?
Posted 20 January 2012 - 04:48 PM
Posted 20 January 2012 - 09:49 PM
Using pointers or getter functions are not related to each other or exclusive. Needing more code is incorrect. Extra function call is 99% incorrect. Needing more memory is incorrect. The reason people use getter functions is becouse they want the class to be a stuct.
I'm wondering why people don't use pointers instead of getter functions. It's needs much less code, less memory and doesn't require a function call. The reason people use getter functions(at least from my knowledge) is because they want to create variables that can be used in the rest of their code without letting it be written to. Can someone explain to me what I'm missing here?