| Thread overview | |||||
|---|---|---|---|---|---|
|
July 20, 2004 "out" always works as "inout"? | ||||
|---|---|---|---|---|
| ||||
I've understood the documentation correctly, using "out" in a parameter declaration should "blank out" the variable, but this doesn't seem to work:
void main()
{
void func(out int i) {}
int i = 10;
printf("%d\n", i);
func(i); // i should be set to 0, but is not
printf("%d, should be %d\n", i, int.init);
}
Nick
| ||||
July 21, 2004 Re: "out" always works as "inout"? | ||||
|---|---|---|---|---|
| ||||
Posted in reply to Nick | derek parnell on the main D messageboard had the same problem. i swear out worked correctly in 0.94. | |||
Copyright © 1999-2021 by the D Language Foundation
Permalink
Reply