D - Question on 'out' parameter
- Kazuhiro Inaba (20/20) Jan 11 2003 Hi, i have one question about 'out'.
- Walter (4/24) Jan 12 2003 It should be 0. It's a bug.
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
Jan 11 2003
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".Whichis the expected behavior? -- k.inaba
Jan 12 2003