November 12, 2002 Passing reference to array | ||||
---|---|---|---|---|
| ||||
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?
|
November 12, 2002 Re: Passing reference to array | ||||
---|---|---|---|---|
| ||||
Posted in reply to Christof Meerwald | 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? |
Copyright © 1999-2021 by the D Language Foundation