Thread: how to make a poiner array

  1. #1
    Unregistered
    Guest

    how to make a poiner array

    how do you make a pointer array? I have an array that i have to make into a pointer array. The program must not change the original array or create any other integer/float arrays???
    Please help

  2. #2
    ATH0 quzah's Avatar
    Join Date
    Oct 2001
    Posts
    14,826
    You know how to make a pointer?

    int *intPtr;

    You know how to make an array?

    int intArray[SOME_SIZE];

    Combine them, and get an array of pointers:

    int *ptrArray[SOME_SIZE];

    Now you have an array of pointers to integers. Read it in reverse:

    [SOME_SIZE] == an array

    ptrArray == named 'ptrArray'

    * == of pointers

    int == of type 'int'

    Put it all together: an array of pointers to integers.

    Quzah.
    Hope is the first step on the road to disappointment.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Replies: 16
    Last Post: 05-29-2009, 07:25 PM
  2. Make an array of arrays
    By JOCAAN in forum C Programming
    Replies: 3
    Last Post: 01-02-2009, 12:18 PM
  3. Replies: 2
    Last Post: 07-11-2008, 07:39 AM
  4. Replies: 11
    Last Post: 09-22-2006, 05:21 PM
  5. Quick question about SIGSEGV
    By Cikotic in forum C Programming
    Replies: 30
    Last Post: 07-01-2004, 07:48 PM