Array truble

This is a discussion on Array truble within the C++ Programming forums, part of the General Programming Boards category; I have this code here from DirectX: Code: HRESULT GetIntArray( D3DXHANDLE hParameter, INT* pn, UINT Count ); The DirectX documentation ...

  1. #1
    Registered User
    Join Date
    Aug 2004
    Posts
    731

    Array truble

    I have this code here from DirectX:

    Code:
    HRESULT GetIntArray(
      D3DXHANDLE hParameter,
      INT* pn,
      UINT Count
    );
    The DirectX documentation says this: pn [out] Returns an array of integers.

    I am completely confused as to how this works, specificly the pn array. Do I just simply make an INT* pointer and pass it in, or do I have to create an array or what?

  2. #2
    Captain - Lover of the C
    Join Date
    May 2005
    Posts
    341
    Make an int* pointer and be sure to allocate enough memory to hold "Count" number of elements. It will then fill in the array for you.
    Don't quote me on that... ...seriously

  3. #3
    Registered User
    Join Date
    Aug 2004
    Posts
    731
    Ahh ok makes sence now. Thanks.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Replies: 16
    Last Post: 05-29-2009, 07:25 PM
  2. from 2D array to 1D array
    By cfdprogrammer in forum C Programming
    Replies: 17
    Last Post: 03-24-2009, 10:33 AM
  3. [question]Analyzing data in a two-dimensional array
    By burbose in forum C Programming
    Replies: 2
    Last Post: 06-13-2005, 07:31 AM
  4. Unknown Memory Leak in Init() Function
    By CodeHacker in forum Windows Programming
    Replies: 3
    Last Post: 07-09-2004, 09:54 AM
  5. Quick question about SIGSEGV
    By Cikotic in forum C Programming
    Replies: 30
    Last Post: 07-01-2004, 07:48 PM

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