Path: csiph.com!eternal-september.org!reader02.eternal-september.org!.POSTED!not-for-mail From: Keith Thompson Newsgroups: comp.lang.c++ Subject: Re: rational numbers Date: Thu, 23 Sep 2021 10:55:15 -0700 Organization: None to speak of Lines: 28 Message-ID: <878rznmb24.fsf@nosuchdomain.example.com> References: <87fstwmhz0.fsf@nosuchdomain.example.com> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: reader02.eternal-september.org; posting-host="8bcb0bda835272ce79dfeccf3aad56df"; logging-data="4165"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+hvsxaJoFLj/WRxyZSqhdl" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.2 (gnu/linux) Cancel-Lock: sha1:Y/2i0vO0F9o9F8AuOOE4osWFg+I= sha1:pzk7fZdO7nufYPsOXHeNmpDSbv8= Xref: csiph.com comp.lang.c++:81483 HorseyWorsey@the_stables.com writes: > On Wed, 22 Sep 2021 14:13:39 -0700 > Keith Thompson wrote: >>HorseyWorsey@the_stables.com writes: >>[...] >>> But then someone who writes "auto main() -> int" instead of "int main()" >>> and then forgets the return value at the end anyway is probably not someone >>> who writes sensible code. >> >>Were you not aware that reaching the closing "}" of main() does an >>implicit "return 0;"? > > And in C function return types default to int so perhaps for int functions > we shouldn't bother to specify the types? That is neither true nor relevant. C dropped the implicit int rule in 1999. > Whats your point? If he decides > to be a smartarse by using that syntax you'd think he'd dot all the i's etc. My point is that your criticism is invalid. Omitting a final "return 0;" in main is perfectly valid. It's not an i that needs to be dotted. (See the code examples in Stroustrup's books.) -- Keith Thompson (The_Other_Keith) Keith.S.Thompson+u@gmail.com Working, but not speaking, for Philips void Void(void) { Void(); } /* The recursive call of the void */