www.digitalmars.com Home | Search | C & C++ | D | DMDScript | News Groups | index | prev | next
Archives

D Programming
D
D.gnu
digitalmars.D
digitalmars.D.bugs
digitalmars.D.dtl
digitalmars.D.dwt
digitalmars.D.announce
digitalmars.D.learn
digitalmars.D.debugger

C/C++ Programming
c++
c++.announce
c++.atl
c++.beta
c++.chat
c++.command-line
c++.dos
c++.dos.16-bits
c++.dos.32-bits
c++.idde
c++.mfc
c++.rtl
c++.stl
c++.stl.hp
c++.stl.port
c++.stl.sgi
c++.stlsoft
c++.windows
c++.windows.16-bits
c++.windows.32-bits
c++.wxwindows

digitalmars.empire
digitalmars.DMDScript

c++ - Passing reference to array

↑ ↓ ← Christof Meerwald <cmeerw web.de> writes:
here is a test-case:

typedef char my_array[10];

void f(my_array &x)
{ }

void g(my_array &x)
{
  f(x);
// Error: need explicit cast for function parameter 1 to get
// from: char **
// to  : char (*)[10]
}
      
int main()
{
  my_array x;

  g(x);

  return 0;
}


bye, Christof

-- 
http://cmeerw.org                                 JID: cmeerw jabber.at
mailto cmeerw at web.de

...and what have you contributed to the Net?
Nov 12 2002
↑ ↓ → "Matthew Wilson" <dmd synesis.com.au> writes:
For what it's worth, I just checked it, and Borland 5.5, Metrowerks 3.0,
VC++ 7 & Intel 6 all work correctly.

"Christof Meerwald" <cmeerw web.de> wrote in message
news:aqrjtq$o34$1 digitaldaemon.com...
 here is a test-case:

 typedef char my_array[10];

 void f(my_array &x)
 { }

 void g(my_array &x)
 {
   f(x);
 // Error: need explicit cast for function parameter 1 to get
 // from: char **
 // to  : char (*)[10]
 }

 int main()
 {
   my_array x;

   g(x);

   return 0;
 }


 bye, Christof

 --
 http://cmeerw.org                                 JID: cmeerw jabber.at
 mailto cmeerw at web.de

 ...and what have you contributed to the Net?

Nov 12 2002