Path: csiph.com!eternal-september.org!feeder.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail From: Keith Thompson Newsgroups: comp.lang.c Subject: Re: scanf used for to get a line Date: Thu, 03 Nov 2016 13:50:23 -0700 Organization: None to speak of Lines: 27 Message-ID: References: <15ea8d6d-0173-491c-b6b5-b1c57dd61769@googlegroups.com> <236c25a6-8c18-4082-ab3a-86eb55fb2408@googlegroups.com> <0051af43-18c1-4f6c-ac52-608296ece9b8@googlegroups.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Injection-Info: mx02.eternal-september.org; posting-host="1f4b9cbd880ce3f40faed57282e3b9ef"; logging-data="16167"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19KJC89tBJhTXeD1eLK/CnX" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1 (gnu/linux) Cancel-Lock: sha1:4cU/AtwPJkShzszqsjDeJEYtYZ0= sha1:Z9W3c3gxrJZf10Z3RMcvsKYU4IE= Xref: csiph.com comp.lang.c:95695 asetofsymbols@gmail.com writes: > I use now the C without prototypes Why on Earth would you do that? > and sys costant as stdin: For example I can do fflush(0) but not > fflush(stdout) fflush takes a FILE* argument. fflush(0) passes a null pointer, not stdin. (The POSIX fileno for stdin is 0; stdin itself is a non-null pointer of type FILE*.) It happens that fflush(NULL) flushes all active streams for which flushing is defined, so it will probably work by accident. (And of course fflush(stdin) has undefined behavior, though an implementation can choose to define it.) > Yes C is ok even not using prototypes (as int f( int a)) > and abuse all the language > I not find errors of this type > of absence of check... > so I can not use stdin and so not use fgets but scanf(). > I use scanf because it is not serious code only for to game... -- Keith Thompson (The_Other_Keith) kst-u@mib.org Working, but not speaking, for JetHead Development, Inc. "We must do something. This is something. Therefore, we must do this." -- Antony Jay and Jonathan Lynn, "Yes Minister"