home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.lang.c++
- Path: sparky!uunet!utcsri!torn!news.ccs.queensu.ca!vision!liu
- From: liu@vision(John Liu)
- Subject: Passing 2-d arrys to functions
- Message-ID: <C0Hw4n.Hy9@knot.ccs.queensu.ca>
- Sender: liu@vision (Yong Liu)
- Organization: Queen's University, Kingston
- References: <C0H9sA.BGw@newsserver.technet.sg> <24568@alice.att.com>
- Date: Thu, 7 Jan 1993 17:48:23 GMT
- Lines: 27
-
-
- --
- I am trying to learn C++ and have a problem in passing a 2-d matrix to and
- from a function. Specifically, the problem is as follows:
-
- main()
- {
- double a[2][2];
- ......
- func(a);
- }
-
- void func(double b[][]){
- ......
- }
-
- When I tried to compile it, I got error message that the dimension of the matrix
- b is null. However, I did not have any problem in passing any 1-d array
- using the same way. I am working on SUN stations in our department.
-
- Would anyone help me solve this problem?
-
- =============================================================================
- John Liu
- Department of Electrical Engineering
- Queen's University Phone: (613)545-6693
- Kingston, Ontario, Canada K7L 3N6 Email: liu@sound.ee.queensu.ca
-