I'm having issues learning these pointers.. what would you use them for? I don't get it...
Printable View
I'm having issues learning these pointers.. what would you use them for? I don't get it...
Lots of things, arrays, to have a little control over memory usage, edit objects passed into a function without the need to return, all kinds of things. Some people can probably list many more, I just can't think right now, it's also kinda hard thinking of all the things you use them for and then explain it to someone. Sorry, I'm incredibly tired lol
Pointers hold memory addresses. Sometimes when you're dealing with large data structures and you need to send those structures to a function or something, it's a lot easier to send the location of the data structure, than the entire data structure itself.
pointers also allow for dynamic memory allocation/deallocation... you'll learn about that in more detail when you get to learning about linked lists...