January 12, 2003 Question on 'out' parameter | ||||
---|---|---|---|---|
| ||||
Hi, i have one question about 'out'. I compiled the following D program, //------- import c.stdio; void foo(out int bar) { } int main( char[][] arg ) { int bar = 3; foo(bar); printf( "%d", bar ); return 0; } //------- and executing this, "3" was printed. But the online documentation ( http://www.digitalmars.com/d/function.html ) says that bar should be "0". Which is the expected behavior? -- k.inaba |
January 12, 2003 Re: Question on 'out' parameter | ||||
---|---|---|---|---|
| ||||
Posted in reply to Kazuhiro Inaba | It should be 0. It's a bug. "Kazuhiro Inaba" <ki@kmonos.net> wrote in message news:avqlfj$2inf$1@digitaldaemon.com... > Hi, i have one question about 'out'. > I compiled the following D program, > > //------- > import c.stdio; > > void foo(out int bar) > { > } > > int main( char[][] arg ) > { > int bar = 3; > foo(bar); > printf( "%d", bar ); > return 0; > } > //------- > > and executing this, "3" was printed. But the online documentation ( http://www.digitalmars.com/d/function.html ) says that bar should be "0". Which > is the expected behavior? > > -- > k.inaba |
Copyright © 1999-2021 by the D Language Foundation