[A83] Re: C(++) programming


[Prev][Next][Index][Thread]

[A83] Re: C(++) programming




> what about returning a value to the OS (if there is one)? is this possible
> in other functions too?

The value passed to exit() is the same as a value returned by main().
exit() is defined to be called when main() returns, but whether or not this
actually happens and is detectable will vary between implementations (you
will not see this behavior with gcc).

> ok. i tried it. it works. but i really have to say i never had an
> application which calls main from an other function.

You likely won't, because it's not good programming practice and is
forbidden by ANSI C++.






References: