home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1993 #1 / NN_1993_1.iso / spool / comp / lang / cplus / 18805 < prev    next >
Encoding:
Text File  |  1993-01-07  |  1.1 KB  |  39 lines

  1. Newsgroups: comp.lang.c++
  2. Path: sparky!uunet!utcsri!torn!news.ccs.queensu.ca!vision!liu
  3. From: liu@vision(John Liu)
  4. Subject: Passing 2-d arrys to functions
  5. Message-ID: <C0Hw4n.Hy9@knot.ccs.queensu.ca>
  6. Sender: liu@vision (Yong Liu)
  7. Organization: Queen's University, Kingston
  8. References: <C0H9sA.BGw@newsserver.technet.sg> <24568@alice.att.com>
  9. Date: Thu, 7 Jan 1993 17:48:23 GMT
  10. Lines: 27
  11.  
  12.  
  13. -- 
  14. I am trying to learn C++ and have a problem in passing a 2-d matrix to and 
  15.    from a function. Specifically, the problem is as follows:
  16.  
  17.    main()
  18.    {
  19.    double a[2][2];
  20.    ......
  21.    func(a);
  22.    }
  23.  
  24.    void func(double b[][]){
  25.    ......
  26.    }
  27.  
  28.    When I tried to compile it, I got error message that the dimension of the matrix 
  29.    b is null. However, I did not have any problem in passing any 1-d array
  30.    using the same way. I am working on SUN stations in our department.
  31.  
  32.    Would anyone help me solve this problem?
  33.  
  34. =============================================================================
  35. John Liu 
  36. Department of Electrical Engineering
  37. Queen's University                       Phone:  (613)545-6693
  38. Kingston, Ontario, Canada K7L 3N6        Email:  liu@sound.ee.queensu.ca
  39.