Archived

This topic is now archived and is closed to further replies.

Pointer Preference

This topic is 5109 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I use pointers when they are the best solution to the problem. I like to have structs where some data is seperate and some is common. I make a structure of common elements, and each struct/class can point to them, one change updates all the structures.

There are lots of uses like that. As references for data structure nodes, like trees and linked lists of course.

And when I need an array of un-defined size.

And when passing large objects, better to use a pointer, cuz otherwise the compiler will make a copy of the object itself.

Hope that''s the kind of stuff you are looking for.

Share this post


Link to post
Share on other sites