Yahoo Answers is shutting down on May 4th, 2021 (Eastern Time) and beginning April 20th, 2021 (Eastern Time) the Yahoo Answers website will be in read-only mode. There will be no changes to other Yahoo properties or services, or your Yahoo account. You can find more information about the Yahoo Answers shutdown and how to download your data on this help page.

When Will I Ever Use Pointers Or Arrays?

Okay, so I'm doing some programming, and I'm stuck. I don't like pointers of arrays, and I can't see where I will use them. I want to make games, how will I use them? Don't say to store usernames and passwords. I want to know. I don't retain info well if I don't see a need, or use.

2 Answers

Relevance
  • 9 years ago
    Favorite Answer

    It's clear you're using a programming language like C/C++. Many more modern languages don't use pointers. You will certainly use arrays.

    Many languages such as Java, Ruby, Groovy, Scala, Flash/Flex/ActionScript all have concepts extremely similar to arrays called lists. Anytime you have a collection of things that you care what order they appear in, it'll be in a list. I can have a list of enemies on the screen, objects in a bag, or even a list of instant messages sent to me.

    You'll also use LinkedLists, Trees, Graphs, and Maps (aka hashmaps). These are all very important concepts for programming in games.

    If you want to program games in C/C++, you'll need to get over your hatred of pointers. Otherwise, you'll want to switch languages.

    I know it's hard to retain info, but it's a skill you'll have to work on. Figure out some methodology that works for you. In Computer Science, there is a lot of information that you won't have immediate applications for. You will want to learn and retain this information otherwise, you'll be very hard for you to get a long term good job.

  • 9 years ago

    If you wanna make games, you will use A LOT of EVERYTHING, pointers and arrays are no exception.

    Pointers are used as a reference by the compiler to point to an object, for example. Any time you want to use an object (or sometimes a variable or an array) you will have to use a pointer. iPhone and iPad games, for example, thanks to objective C, are FULL of pointers.

    Arrays are groups of variables. they are also something you will use often, any time you want to link two variables, create a list, etc. Example: if your games have items, you will need a list of items, and that will be saved within an array; that also goes for monsters, equipment, maps, even playing cards, game pieces and platforms. Arrays can also be used for operations that are a bit more complicated, like using stacks, etc.

    Both concepts are very basic, and there is simply no escaping them if you ever want to make anything decent =p

    As for "pointers of arrays", depending on the language you use, they can be the only way to effectively use an array, and then the importance of the array varies.

    Hope it helps

Still have questions? Get your answers by asking now.