Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.c++ > #84128

Re: C++ (and some C) quiz questions

Path csiph.com!eternal-september.org!reader02.eternal-september.org!.POSTED!not-for-mail
From Ben <ben.usenet@bsb.me.uk>
Newsgroups comp.lang.c++
Subject Re: C++ (and some C) quiz questions
Date Mon, 16 May 2022 22:19:25 +0100
Organization A noiseless patient Spider
Lines 37
Message-ID <875ym5rx9e.fsf@bsb.me.uk> (permalink)
References <t5tc3s$164p$1@gioia.aioe.org> <t5u3kb$h0k$1@dont-email.me> <t5u6es$a95$1@dont-email.me> <t5u6uh$e6l$1@dont-email.me> <t5ua8a$1tb9$1@gioia.aioe.org> <t5ub23$e9h$1@dont-email.me> <t5ud94$uet$1@dont-email.me>
MIME-Version 1.0
Content-Type text/plain
Injection-Info reader02.eternal-september.org; posting-host="b0fc61641ca02cb866397cabd0f2f2d4"; logging-data="5764"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19bzPVAOQqqDMsNDnCovkGPIwwsIMigBC0="
Cancel-Lock sha1:erQIcGE7wYUaLasrKMDOTwd2Fbs= sha1:XvR97cX+obcWRCLn1NG52/MDoC0=
X-BSB-Auth 1.76c357222da1cce8af1f.20220516221925BST.875ym5rx9e.fsf@bsb.me.uk
Xref csiph.com comp.lang.c++:84128

Show key headers only | View raw


Andrey Tarasevich <andreytarasevich@hotmail.com> writes:

> On 5/16/2022 1:09 PM, Christian Gollwitzer wrote:
>> BTW, in old C when the types were omitted, it was implicit int. 
>
> However even then you had to designate a declaration as a declaration
> by specifying at least a qualifier or a storage class specifier.

Not always.

> You could say
>
>   const x = 1; /* relies on "implicit int" */

Yes, and (ironically, given the suggestion for "implicit auto" in C++)
it was often auto that was used.  We have auto today because of implicit
int of old.

> but you could not just say
>
>   x = 1;
>
> and expect "implicit int" to kick in.

You could at file scope.

> In other words, "implicit int" did not permit you to use undeclared
> variables.

Yes, but you didn't need anything but the name in certain contexts.  For
example this declares a K&R C function that takes an int and returns an
int:

  f(x) { return x+1; }

-- 
Ben.

Back to comp.lang.c++ | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

C++ (and some C) quiz questions Juha Nieminen <nospam@thanks.invalid> - 2022-05-16 11:21 +0000
  Re: C++ (and some C) quiz questions Paavo Helde <eesnimi@osa.pri.ee> - 2022-05-16 17:35 +0300
    Re: C++ (and some C) quiz questions Juha Nieminen <nospam@thanks.invalid> - 2022-05-16 16:13 +0000
  Re: C++ (and some C) quiz questions Andrey Tarasevich <andreytarasevich@hotmail.com> - 2022-05-16 10:49 -0700
  Re: C++ (and some C) quiz questions Christian Gollwitzer <auriocus@gmx.de> - 2022-05-16 20:02 +0200
    Re: C++ (and some C) quiz questions "Alf P. Steinbach" <alf.p.steinbach@gmail.com> - 2022-05-16 20:51 +0200
      Re: C++ (and some C) quiz questions Christian Gollwitzer <auriocus@gmx.de> - 2022-05-16 20:59 +0200
        Re: C++ (and some C) quiz questions Manfred <noname@add.invalid> - 2022-05-16 21:55 +0200
          Re: C++ (and some C) quiz questions Christian Gollwitzer <auriocus@gmx.de> - 2022-05-16 22:09 +0200
            Re: C++ (and some C) quiz questions Andrey Tarasevich <andreytarasevich@hotmail.com> - 2022-05-16 13:47 -0700
              Re: C++ (and some C) quiz questions Ben <ben.usenet@bsb.me.uk> - 2022-05-16 22:19 +0100
                Re: C++ (and some C) quiz questions Andrey Tarasevich <andreytarasevich@hotmail.com> - 2022-05-16 14:52 -0700
                Re: C++ (and some C) quiz questions Ben <ben.usenet@bsb.me.uk> - 2022-05-16 22:57 +0100
            Re: C++ (and some C) quiz questions Paavo Helde <eesnimi@osa.pri.ee> - 2022-05-17 00:54 +0300
              Re: C++ (and some C) quiz questions Ben <ben.usenet@bsb.me.uk> - 2022-05-17 00:34 +0100
                Re: C++ (and some C) quiz questions Christian Gollwitzer <auriocus@gmx.de> - 2022-05-17 08:24 +0200
                Re: C++ (and some C) quiz questions Juha Nieminen <nospam@thanks.invalid> - 2022-05-17 08:21 +0000
                Re: C++ (and some C) quiz questions Ben <ben.usenet@bsb.me.uk> - 2022-05-17 11:06 +0100
        Re: C++ (and some C) quiz questions Juha Nieminen <nospam@thanks.invalid> - 2022-05-17 04:41 +0000
          Re: C++ (and some C) quiz questions Ben <ben.usenet@bsb.me.uk> - 2022-05-17 11:12 +0100
            Re: C++ (and some C) quiz questions Paavo Helde <eesnimi@osa.pri.ee> - 2022-05-17 14:37 +0300
              Re: C++ (and some C) quiz questions Ben <ben.usenet@bsb.me.uk> - 2022-05-17 14:31 +0100
            Re: C++ (and some C) quiz questions Tim Rentsch <tr.17687@z991.linuxsc.com> - 2022-05-17 04:53 -0700
              Re: C++ (and some C) quiz questions Juha Nieminen <nospam@thanks.invalid> - 2022-05-18 04:40 +0000
                Re: C++ (and some C) quiz questions Manfred <noname@add.invalid> - 2022-05-18 13:29 +0200
                Re: C++ (and some C) quiz questions Tim Rentsch <tr.17687@z991.linuxsc.com> - 2022-05-18 06:57 -0700
                Re: C++ (and some C) quiz questions Paavo Helde <eesnimi@osa.pri.ee> - 2022-05-18 17:37 +0300
                Re: C++ (and some C) quiz questions Juha Nieminen <nospam@thanks.invalid> - 2022-05-19 14:43 +0000
                Re: C++ (and some C) quiz questions Tim Rentsch <tr.17687@z991.linuxsc.com> - 2022-05-19 08:21 -0700
                Re: C++ (and some C) quiz questions Tim Rentsch <tr.17687@z991.linuxsc.com> - 2022-05-18 06:01 -0700

csiph-web