calling subroutines to populate array??help

This is a discussion on calling subroutines to populate array??help within the C Programming forums, part of the General Programming Boards category; well, obviously I am extremely new to c.....I am really having trouble with this. My book doesn't really explain my ...

  1. #1
    Registered User
    Join Date
    Apr 2003
    Posts
    1

    Question calling subroutines to populate array??help

    well, obviously I am extremely new to c.....I am really having trouble with this. My book doesn't really explain my problem.

    could someone give me an example of how to populate a 2 dimmensional array (200 rows and 3 columns) by calling 3 different subroutines?

    can't really find an example of how to do this, i really want to figure it out on my own...but I kinda need a short example on how an array can call a subroutine.....

    hope my question isn't too dumb.

    thanks.

  2. #2
    Registered User Vber's Avatar
    Join Date
    Nov 2002
    Posts
    807
    First of all, hello
    Now, let me understand your question, you have a 2D array, you want to populate it by calling 3 functions? this shouldn't be a problem, make 3 functions that receives a 2D dimensional array as parameter:
    Code:
    void myFunc1 (int arr[][3]);
    Look that I'm just passing the [][3] - you cannot do something like [][]. You can pass it in other ways, like in pointers. Now, from that function make whatever you want with this array, all changes you'll make there, it will affect in the array automatic.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Stack issues when calling a COM library
    By notnot in forum C Programming
    Replies: 3
    Last Post: 06-01-2009, 03:12 AM
  2. calling functions within functions
    By edd1986 in forum C Programming
    Replies: 3
    Last Post: 03-29-2005, 03:35 AM
  3. calling default instead of argument constructor, why?!
    By cppn00b in forum C++ Programming
    Replies: 6
    Last Post: 01-30-2005, 04:24 AM
  4. calling conventions
    By Micko in forum C Programming
    Replies: 2
    Last Post: 07-18-2004, 10:13 AM
  5. Question on function syntax and calling function
    By cbrman in forum C Programming
    Replies: 10
    Last Post: 10-05-2003, 06:32 PM

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