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


Groups > comp.lang.c > #24953

Re: dereference

From Ike Naar <ike@iceland.freeshell.org>
Newsgroups comp.lang.c
Subject Re: dereference
Date 2012-08-25 20:39 +0000
Organization A noiseless patient Spider
Message-ID <slrn3vfsk3idvq.g5v.ike@iceland.freeshell.org> (permalink)
References (10 earlier) <GpudnbIvWLDzJ6rNnZ2dnUVZ_oydnZ2d@bestweb.net> <k19353$1mo$1@speranza.aioe.org> <qrlg38955oc3umvh61b06q27hmb25kuov8@4ax.com> <k1akvt$8fq$1@speranza.aioe.org> <3e0f696e-d409-4f07-9e60-16d79f12a64a@googlegroups.com>

Show all headers | View raw


On 2012-08-25, Adrian Ratnapala <adrian.ratnapala@gmail.com> wrote:
>     char key[] = "some stuff";
>
> In this case the compiler allocates ten bytes on the stack,

Eleven bytes, and not necessarily on the stack.

> and initialises them with "some stuff\0".

No, it initializes them with "some stuff", the string constant already
includes the terminating null char. "some stuff\0" would be 12 bytes
long and have two null chars at the end.

> These bytes are an array of type `char[10]`.

No, char[11],
[0] 's'
[1] 'o'
[2] 'm'
[3] 'e'
[4] ' '
[5] 's'
[6] 't'
[7] 'u'
[8] 'f'
[9] 'f'
[10] '\0'

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


Thread

dereference "Bill Cunningham" <nospam@nspam.invalid> - 2012-08-20 18:04 -0400
  Re: dereference Keith Thompson <kst-u@mib.org> - 2012-08-20 15:30 -0700
    Re: dereference "Bill Cunningham" <nospam@nspam.invalid> - 2012-08-20 18:37 -0400
      Re: dereference Keith Thompson <kst-u@mib.org> - 2012-08-20 18:43 -0700
      Re: dereference Kenneth Brody <kenbrody@spamcop.net> - 2012-08-22 14:42 -0400
        Re: dereference Keith Thompson <kst-u@mib.org> - 2012-08-22 12:10 -0700
          Re: dereference Kenneth Brody <kenbrody@spamcop.net> - 2012-08-22 17:38 -0400
    Re: dereference "Bill Cunningham" <nospam@nspam.invalid> - 2012-08-20 21:09 -0400
      Re: dereference Keith Thompson <kst-u@mib.org> - 2012-08-20 18:46 -0700
        Re: dereference "Bill Cunningham" <nospam@nspam.invalid> - 2012-08-21 16:15 -0400
        Re: dereference "Bill Cunningham" <nospam@nspam.invalid> - 2012-08-21 16:26 -0400
      Re: dereference Kenneth Brody <kenbrody@spamcop.net> - 2012-08-22 14:49 -0400
        Re: dereference "Bill Cunningham" <nospam@nspam.invalid> - 2012-08-22 18:10 -0400
          Re: dereference Barry Schwarz <schwarzb@dqel.com> - 2012-08-22 17:36 -0700
            Re: dereference "Bill Cunningham" <nospam@nspam.invalid> - 2012-08-22 20:50 -0400
              Re: dereference Keith Thompson <kst-u@mib.org> - 2012-08-22 17:54 -0700
                Re: dereference "Bill Cunningham" <nospam@nspam.invalid> - 2012-08-22 21:23 -0400
                Re: dereference "Bill Cunningham" <nospam@nspam.invalid> - 2012-08-22 21:26 -0400
                Re: dereference Kenneth Brody <kenbrody@spamcop.net> - 2012-08-23 12:55 -0400
                Re: dereference Mark Bluemel <mark_bluemel@pobox.com> - 2012-08-24 08:05 +0100
                Re: dereference Hans Vlems <hvlems@freenet.de> - 2012-08-24 03:00 -0700
                Re: dereference Kenneth Brody <kenbrody@spamcop.net> - 2012-08-24 13:31 -0400
                Re: dereference "Bill Cunningham" <nospam@nspam.invalid> - 2012-08-24 17:20 -0400
                Re: dereference "Bill Cunningham" <nospam@nspam.invalid> - 2012-08-24 19:36 -0400
                Re: dereference Adrian Ratnapala <adrian.ratnapala@gmail.com> - 2012-08-24 20:42 -0700
                Re: dereference Hans Vlems <hvlems@freenet.de> - 2012-08-27 00:11 -0700
                Re: dereference Nick Keighley <nick_keighley_nospam@hotmail.com> - 2012-08-27 02:01 -0700
                Re: dereference Keith Thompson <kst-u@mib.org> - 2012-08-27 03:24 -0700
                Re: dereference Barry Schwarz <schwarzb@dqel.com> - 2012-08-24 21:44 -0700
                Re: dereference "Bill Cunningham" <nospam@nspam.invalid> - 2012-08-25 09:46 -0400
                Re: dereference Vincenzo Mercuri <vincenzo.mercuri@yahoo.it> - 2012-08-25 16:22 +0200
                Re: dereference Vincenzo Mercuri <vincenzo.mercuri@yahoo.it> - 2012-08-25 16:33 +0200
                Re: dereference Adrian Ratnapala <adrian.ratnapala@gmail.com> - 2012-08-25 08:07 -0700
                Re: dereference Vincenzo Mercuri <vincenzo.mercuri@yahoo.it> - 2012-08-25 17:55 +0200
                Re: dereference Adrian Ratnapala <adrian.ratnapala@gmail.com> - 2012-08-25 10:58 -0700
                Re: dereference Ike Naar <ike@iceland.freeshell.org> - 2012-08-25 20:39 +0000
                Re: dereference Adrian Ratnapala <adrian.ratnapala@gmail.com> - 2012-08-26 14:49 -0700
                Re: dereference "Bill Cunningham" <nospam@nspam.invalid> - 2012-08-25 18:36 -0400
                Re: dereference Keith Thompson <kst-u@mib.org> - 2012-08-25 16:42 -0700
                Re: dereference "Bill Cunningham" <nospam@nspam.invalid> - 2012-08-25 20:19 -0400
                Re: dereference Adrian Ratnapala <adrian.ratnapala@gmail.com> - 2012-08-26 14:40 -0700
                Re: dereference Adrian Ratnapala <adrian.ratnapala@gmail.com> - 2012-08-26 14:46 -0700
                Re: dereference Nick Keighley <nick_keighley_nospam@hotmail.com> - 2012-08-27 02:11 -0700
                Re: dereference James Kuyper <jameskuyper@verizon.net> - 2012-08-27 08:36 -0400
                Re: dereference Adrian Ratnapala <adrian.ratnapala@gmail.com> - 2012-08-27 10:38 -0700
                Re: dereference James Kuyper <jameskuyper@verizon.net> - 2012-08-27 13:55 -0400
                Re: dereference Adrian Ratnapala <adrian.ratnapala@gmail.com> - 2012-08-27 12:57 -0700
                Re: dereference James Kuyper <jameskuyper@verizon.net> - 2012-08-27 16:25 -0400
                Re: dereference Kenneth Brody <kenbrody@spamcop.net> - 2012-08-29 10:41 -0400
                Re: dereference Nick Keighley <nick_keighley_nospam@hotmail.com> - 2012-08-27 02:09 -0700
                Re: dereference Barry Schwarz <schwarzb@dqel.com> - 2012-08-25 12:16 -0700
                Re: dereference Keith Thompson <kst-u@mib.org> - 2012-08-25 16:40 -0700
                Re: dereference "Bill Cunningham" <nospam@nspam.invalid> - 2012-08-25 21:21 -0400
                Re: dereference Barry Schwarz <schwarzb@dqel.com> - 2012-08-25 21:48 -0700
                Re: dereference Les Cargill <lcargill99@comcast.com> - 2012-08-25 13:08 -0500
                Re: dereference Nick Keighley <nick_keighley_nospam@hotmail.com> - 2012-08-27 02:02 -0700
                Re: dereference Andrew Cooper <amc96@cam.ac.uk> - 2012-08-25 02:53 +0100
                Re: dereference Hans Vlems <hvlems@freenet.de> - 2012-08-27 00:10 -0700
                Re: dereference Nick Keighley <nick_keighley_nospam@hotmail.com> - 2012-08-27 02:14 -0700
                Re: dereference Adrian Ratnapala <adrian.ratnapala@gmail.com> - 2012-08-27 10:34 -0700
                Re: dereference Kenneth Brody <kenbrody@spamcop.net> - 2012-08-29 10:22 -0400
  Re: dereference Les Cargill <lcargill99@comcast.com> - 2012-08-20 17:38 -0500
    Re: dereference "Bill Cunningham" <nospam@nspam.invalid> - 2012-08-20 18:41 -0400
  Re: dereference "christian.bau" <christian.bau@cbau.wanadoo.co.uk> - 2012-08-20 16:43 -0700
    Re: dereference Mark Bluemel <mark_bluemel@pobox.com> - 2012-08-21 09:22 +0100
    Re: dereference "Bill Cunningham" <nospam@nspam.invalid> - 2012-08-21 16:12 -0400

csiph-web