pointers or arrays

Started by
20 comments, last by gamehunter101 17 years, 1 month ago
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.
Advertisement
Arrays are very basic and easy to understand, I would learn them first than pointers.
____________________VB/C++/C# Programmer
Quote:Original post by Jettoz
Arrays are very basic and easy to understand, I would learn them first than pointers.


thank you
Arrays.. pointers you will "learn" about 20 times before you learn them .. hehehe
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.
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.
Comrade, Listen! The Glorious Commonwealth's first Airship has been compromised! Who is the saboteur? Who can be saved? Uncover what the passengers are hiding and write the grisly conclusion of its final hours in an open-ended, player-driven adventure. Dziekujemy! -- Karaski: What Goes Up...
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?
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