how to make a poiner array

This is a discussion on how to make a poiner array within the C Programming forums, part of the General Programming Boards category; how do you make a pointer array? I have an array that i have to make into a pointer 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, 08: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, 08:39 AM
  4. Replies: 11
    Last Post: 09-22-2006, 06:21 PM
  5. Quick question about SIGSEGV
    By Cikotic in forum C Programming
    Replies: 30
    Last Post: 07-01-2004, 08:48 PM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21