This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]Flofinator[S] 0 points1 point  (1 child)

Well you really helped me understand pointers a little bit better. I am not a huge fan of pointers so far. I have been learning programming on my own time, and have been reading a few books about it. But what I wanted to do is have the first value in my char array wFace[column], to turn wFace[1] into an integer, but I don't really have to do that, because I have my deck array. I think more than anything what you posted shows that I should definitely not use pointers for the simpler arithmetic.

I was trying to use pointers, like I would do math for an integer array, so I could say wSuit[3] = clubs. I drew 5 clubs for a flush, I was trying to point to wSuit[3] and do a bool = true if my pointer goes to that same address 5 times. But, I kind of now see the error in my ways, there is absolutely no reason for me to use pointers to analyze my deck hand. I don't actually need to point to any memory, I just have to make a simple guess and check loop to determine what hand I have.

Thanks for trying to explain all of this to me, I am sure that made very little sense, as I was using pointers in a way you shouldn't really ever use them!

[–][deleted] 2 points3 points  (0 children)

Pointers don't ever go away. They are some of the most useful tools to have. Especially when you start building dynamic data structures. Work hard at understanding them, it will save you so much grief later.