Thread: Calling a function with 2-D array

  1. #1
    Registered User
    Join Date
    Apr 2009
    Posts
    11

    Calling a function with 2-D array

    So I'm trying to call a function with a 2-D array. First of all, I have this:

    Code:
    #define DATELEN 9
    #define NAMELEN 20
    #define NCOL 3
    Then, I define the function:

    Code:
    int readStats( char date[][DATELEN], char team[][NAMELEN], int stats[][NCOL] );
    When I try to call it with this:

    Code:
     nGames = readStats( char date[][DATELEN], char team[][NAMELEN], int stats[][NCOL] );
    I get the error:

    Code:
    error: parse error before "char"
    For some reason I can't figure this out, can someone help me? Thanks!

  2. #2
    ATH0 quzah's Avatar
    Join Date
    Oct 2001
    Posts
    14,826
    You could try searching, since this question gets asked every single day. Or you could read the C programming FAQ. (click)


    Quzah.
    Hope is the first step on the road to disappointment.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Replies: 4
    Last Post: 05-13-2011, 08:28 AM
  2. Calling an array into another in a function
    By kroms in forum C Programming
    Replies: 7
    Last Post: 02-28-2009, 09:07 PM
  3. Undefined Reference Compiling Error
    By AlakaAlaki in forum C++ Programming
    Replies: 1
    Last Post: 06-27-2008, 11:45 AM
  4. Quick question about SIGSEGV
    By Cikotic in forum C Programming
    Replies: 30
    Last Post: 07-01-2004, 07:48 PM
  5. structure vs class
    By sana in forum C++ Programming
    Replies: 13
    Last Post: 12-02-2002, 07:18 AM