pointers or arrays
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.
Quote:Original post by Jettoz
Arrays are very basic and easy to understand, I would learn them first than pointers.
thank you
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.
I recommend this tutorial instead.
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.
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.
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?
I second Zahlman's suggestion, though I do not agree about his initial statement: why are arrays necessary for understanding pointers?
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.
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.
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 :)
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement