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: Understanding the program that has pointers to two_dimensional arrays Date: Mon, 05 Dec 2016 12:21:09 -0800 Organization: None to speak of Lines: 21 Message-ID: References: <481da833-61f6-4f1c-973b-1b129118c682@googlegroups.com> <87zikagpiw.fsf@bsb.me.uk> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Injection-Info: mx02.eternal-september.org; posting-host="f21d38049ad0d524c578eed3c5fbedbb"; logging-data="19552"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/aICcWU7mWPsPJNYQwlVKV" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1 (gnu/linux) Cancel-Lock: sha1:0duubUNAAIsfKe8Qi0kniAhXWgg= sha1:BHxDbM4Tb+h0xbj4KWBpnJvQRqo= Xref: csiph.com comp.lang.c:98062 Ben Bacarisse writes: > Keith Thompson writes: >> Alla _ writes: [...] >>> printf(" %d",(int)(rowptr[row] - rowptr[row-1])); > >> On my system, the pointers differ by 48 bytes, which is probably >> an indication of how much overhead when malloc allocates 8 bytes >> (sizeof (int*)). > > The allocations are for 10 ints and so are very likely to be 40 bytes. > > Right, my mistake. -- 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"