Jump to content
  • Advertisement
Sign in to follow this  
gamehunter101

pointers or arrays

This topic is 4112 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

Well I'm up to the pointers lesson on cprogramming.com and I'm also reading a book the book has arrays before pointers and this site has it the opposite.Which should I learn first?Thanks in advance.

Share this post


Link to post
Share on other sites
Advertisement
It really isn't possible to learn about one without the other. Anyway, there are more sophisticated tools (that will prevent you from making mistakes and frequently require less effort to learn and use) for almost every circumstance in which either would apply.

I recommend this tutorial instead.

Share this post


Link to post
Share on other sites
Well, arrays are basically pointers in a nifty coat, so starting with pointers might be a better way to go.

Though, TBH, it really doesn't matter. Once you have grasped both concepts (which aren't too difficult), the order you grasped them in won't make any difference.

Share this post


Link to post
Share on other sites
It's funny — I can handle pointers perfectly well, but arrays still sometimes give me trouble. I guess everyone has their own weaknesses.

I second Zahlman's suggestion, though I do not agree about his initial statement: why are arrays necessary for understanding pointers?

Share this post


Link to post
Share on other sites
Pointers are the trickier concept. In C++ pointers have an elegant interface/implementation but arrays don't. Well actually no, the pointer declaration syntax is counterintuitive in C++ but you soon learn to ignore it. So if you think that you are really smart then I would go with pointers first, otherwise I would go for arrays first.

Share this post


Link to post
Share on other sites
Quote:
Original post by Glak
Well actually no, the pointer declaration syntax is counterintuitive in C++ but you soon learn to ignore it.


In fact, the entire C type system is like that, and C++ has kept most of it as legacy. See also cdecl.

Share this post


Link to post
Share on other sites
Quote:
Original post by ToohrVyk
It's funny — I can handle pointers perfectly well, but arrays still sometimes give me trouble. I guess everyone has their own weaknesses.

I second Zahlman's suggestion, though I do not agree about his initial statement: why are arrays necessary for understanding pointers?


Um, I didn't really think that one through :)

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!