Thread: Question : Passing Array Arguments as Pointers

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Registered User
    Join Date
    Dec 2010
    Posts
    1

    Question Question : Passing Array Arguments as Pointers

    "Pointers" in topic may be "Pointer's".

    Hi all.

    There is a two dimensional A[5][6] array declared and this is wanted from me :

    . Pass the array A and its dimensions (number of rows and
    columns) to the FUNCTON1 as arguments.
    Number of rows and columns should be passed as POINTER
    arguments.
    And this is how i defined function and passed array into it :

    Code:
    void func1 (int *a1Ptr, int a1row, int a1column) // The function 
    
    func1 (*A, 5, 6); // This is how I pass array into it
    Program works and everything is ok.

    So my question is, did i do it right as it wanted ? If not, then how to do it like in the question.

    Thanks in advance.
    Last edited by NEMEAN; 12-04-2010 at 02:57 PM.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Replies: 7
    Last Post: 11-21-2008, 04:27 PM
  2. Passing a 2d Array of pointers to a Function
    By miclus in forum C Programming
    Replies: 6
    Last Post: 09-11-2004, 07:34 AM
  3. Quick question about SIGSEGV
    By Cikotic in forum C Programming
    Replies: 30
    Last Post: 07-01-2004, 07:48 PM
  4. passing structs & pointers to structs as arguments
    By Markallen85 in forum C Programming
    Replies: 6
    Last Post: 03-16-2004, 07:14 PM
  5. Question about Templates and passing arguments
    By supaben34 in forum C++ Programming
    Replies: 2
    Last Post: 10-13-2002, 01:32 AM