Thread: Multi-Dimension Array Declaration...

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Registered User
    Join Date
    Aug 2006
    Posts
    13

    Multi-Dimension Array Declaration...

    Hi, Im currently teaching myself c++ and translating some of my java programs, to ease the transition. Could anyone tell me how to translate the following piece of code

    Code:
     
    
    int[][] myArray;
    
    public void doSomething(int[][] myArray)
    {
          this.myarray = myarray;
    }
    I've tried what i thought would be logical, in the header file having

    Code:
    int myArray[][];
    then in the class file

    Code:
    void ThisClass::doSomething(int array[][])
    {
         myArray = array;
    }
    But it wants the initial dimensions size when I try to compile it. Problem is, I wont know how big the array is, untill the method receives it.
    Last edited by HIM; 10-31-2006 at 04:06 AM.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Replies: 1
    Last Post: 04-25-2006, 12:14 AM
  2. Errors with including winsock 2 lib
    By gamingdl'er in forum C++ Programming
    Replies: 3
    Last Post: 12-05-2005, 08:13 PM
  3. Dikumud
    By maxorator in forum C++ Programming
    Replies: 1
    Last Post: 10-01-2005, 06:39 AM
  4. Quick question about SIGSEGV
    By Cikotic in forum C Programming
    Replies: 30
    Last Post: 07-01-2004, 07:48 PM
  5. multi array to function
    By Unregistered in forum C Programming
    Replies: 2
    Last Post: 09-09-2001, 03:01 AM