Passing point to array[][] to a function

This is a discussion on Passing point to array[][] to a function within the C Programming forums, part of the General Programming Boards category; I have a 2d array bZBuffer[][] and i want to pass a pointer to this array to a function but ...

  1. #1
    Registered User gazsux's Avatar
    Join Date
    Mar 2002
    Posts
    72

    Passing pointer to array[][] to a function

    I have a 2d array bZBuffer[][] and i want to pass a pointer to this array to a function but i cant figure out how. I know its easy, just one of those days. In fact I looked it up in a book and their version doesn't work

    this is what i have at the mo

    function prototype:
    Code:
    void Rasterise(int iObjectCount, Buffer ***bZBuffer);
    call:
    Code:
    Rasterise(iCountO, &bZBuffer);
    I know its basic error, cheers for any help
    Last edited by gazsux; 04-22-2003 at 03:31 PM.

  2. #2
    Just Lurking Dave_Sinkula's Avatar
    Join Date
    Oct 2002
    Posts
    5,006
    Would this help?
    7. It is easier to write an incorrect program than understand a correct one.
    40. There are two ways to write error-free programs; only the third one works.*

  3. #3
    Registered User
    Join Date
    Apr 2003
    Posts
    9
    How would you pass a 2d string array "Pointer" which contains a list of names to a function? What would be the syntax to Define the Array in the Main module/program, and then to Declare and to Call the function? Thanks!



    This question is in reference to my earlier problem, because I have very little experience with this code situation.

    Please Help me with debugging "Arrays & Functions" in code...
    Last edited by FYX193; 04-28-2003 at 03:25 PM.

  4. #4
    Registered User
    Join Date
    Apr 2003
    Posts
    9
    Well, thanks for the input... I'll try to remember it for next time. I just opted for global variables in my situation to make things simple. I'll try what you said on my code to see if that fixes it. Thanks Again!

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Change this program so it uses function??
    By stormfront in forum C Programming
    Replies: 8
    Last Post: 11-01-2005, 07:55 AM
  2. Compiler "Warnings"
    By Jeremy G in forum A Brief History of Cprogramming.com
    Replies: 24
    Last Post: 04-24-2005, 01:09 PM
  3. c++ linking problem for x11
    By kron in forum Linux Programming
    Replies: 1
    Last Post: 11-19-2004, 09:18 AM
  4. Passing my array to function
    By pooty tang in forum C Programming
    Replies: 8
    Last Post: 09-15-2004, 12:19 PM
  5. Replies: 1
    Last Post: 05-28-2002, 11:20 AM

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