What is a void main() that returns a value?
Pierre Rouleau
prouleau at impathnetworks.com
Sat Nov 18 10:00:21 PST 2006
With DMD 0.179:
- A void main with no return statement returns 0, a decent choice.
- A void main with a return statement is accepted without warning or
compiler error. Is this a bug?
// ------------------
void
main()
{
return 1; // returns 1 to the OS
}
// --------BAD--------
void
main()
{
return 1.0; // returns 33 to the OS
}
// --------BAD--------
void
main()
{
return "0123456789"; // returns 48 to the OS
}
--
P.R.
More information about the Digitalmars-d
mailing list