I'm an (almost) 3rd year computer science student. I had a C++ programming module, but it did not go into details, just covered the basics. It introduced us to pointers, but I'm still wondering this:
Why (in what cases or circumstances) would one want to use a pointer to an int, as opposed to simply making an int itself? In other words, what are some good situations where using a pointer to a variable is better than simply declaring and initializing the variable itself? When are pointers to variables better than variables themselves?
No comments:
Post a Comment