🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: vmsnet.internals
Article #389

(None)

#389
From: REGI's
Date: Thu, 15 Oct 1992 16:26
66 lines
3383 bytes
>X-Envelope-to: MACRO32@WKUVX1.bitnet
>X-VMS-To: IN::"MACRO32@WKUVX1.BITNET"

1
12-OCT-1992 12:48:33.64
   1 00:00:00.00
13-OCT-1992 12:48:33.64
@UKCC.uky.edu:MacroMan@WKUVX1.BITNET
gutier@SEVAXU.CICA.ES

Received: from UKCC.uky.edu by ESEVVX.CICA.ES ;  9-OCT-1992 12:48:16.08
Received: from ukcc.uky.edu by UKCC.uky.edu (IBM VM SMTP V2R2)
   with BSMTP id 3044; Fri, 09 Oct 92 07:47:08 EDT
Received: from WKUVX1.BITNET by ukcc.uky.edu (Mailer R2.08) with BSMTP id 5377;
 Fri, 09 Oct 92 07:47:07 EDT
Errors-To: MacroMan@WKUVX1.BITNET
X-ListName: "VMS Internals, MACRO, and BLISS Discussions"
    <MACRO32@WKUVX1.BITNET>
Received: from CUNYVM.BITNET (MAILER) by WKUVX1 (MX V3.1C) with BSMTP; Fri, 09
          Oct 1992 06:44:20 CDT
Received: from CUNYVM by CUNYVM.BITNET (Mailer R2.08) with BSMTP id 2623; Fri,
          09 Oct 92 07:41:54 EDT
Received: from KOPC by CUNYVM.CUNY.EDU (IBM VM SMTP V2R2) with TCP; Fri, 09 Oct
          92 07:41:31 EDT
Received: from DECNET-MAIL (ARNE@KO) by kopc.hhs.dk (PMDF #3400 ) id
          <01GPQTVHA7W08WW0VG@kopc.hhs.dk>; Fri, 9 Oct 1992 12:40:55 +0100
Date: 09 Oct 1992 12:40:54 +0100
From: Arne Vajhxj <ARNE@ko.hhs.dk>
Reply-To: MACRO32@WKUVX1.BITNET
Subject: Re: C Language question
To: MACRO32 <MACRO32@WKUVX1.BITNET>,
    NRA%ipg.ph.kcl.ac.uk@nsfnet-relay.ac.uk
Message-ID: <01GPQTVHA7W28WW0VG@kopc.hhs.dk>
X-VMS-To: KOPC::IN%"@cunyvm.cuny.edu:MACRO32@WKUVX1.BITNET"
X-VMS-Cc: IN::"NRA%ipg.ph.kcl.ac.uk@nsfnet-relay.ac.uk"
MIME-version: 1.0
Content-type: TEXT/PLAIN; CHARSET=ISO-8859-1
Content-transfer-encoding: 8BIT

> Question: in C, if one declares char a[I][J], is there anything in the
> language standard that guarantees that &a[0][0] is the first of a set of
> I*J contiguous chars, and that a[i+1][0] is guaranteed to be the same
> storage location as a[i][J] ).
>
> A friend asserts that it is, and says his experience on several systems
> 'proves' this. My belief is that there is nothing that says this will
> always be the case, and that the only constraint is that every valid pointer
> a[i] will point to J chars. Which of us is right?

I think your friend is rigth (a[I][J] would be I*J contigious bytes), but
I can not prove it, but ...

The arguments are:
  1)  As your friend has observed C-compilers tend to do it that way.
  2)  The creative way C lets you manipulate arrays, pointers and
      addresses must somehow assume, that they are stored contigious.
  3)  It is most efficient that way (simpler address calculations).

But to be absolutely certain you will need to check the real sources:
K&R and the ANSI specifications.

                                                          Arne

Arne Vajhxj                             local DECNET:  KO::ARNE
Computer Department                     PSI:           PSI%23831001304030::ARNE
Business School of Southern Denmark     Internet:      ARNE@KO.HHS.DK
Technical Details
Message-ID: <01GPZHTP9W4G0001ZZ@esevvx.cica.es>
Path: arc1-ca.pugleaf.net!sparky!uunet!stanford.edu!agate!usenet.ins.cwru.edu!magnus.acs.ohio-state.edu!zaphod.mps.ohio-state.edu!usc!news.service.uci.edu!unogate!mvb.saic.com!macro32

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!sparky!uunet!stanford.edu!agate!usenet.ins.cwru.edu!magnus.acs.ohio-state.edu!zaphod.mps.ohio-state.edu!usc!news.service.uci.edu!unogate!mvb.saic.com!macro32
From: REGI's <NUNEZ@esevvx.cica.es>
Newsgroups: vmsnet.internals
Subject: (None)
Message-ID: <01GPZHTP9W4G0001ZZ@esevvx.cica.es>
Date: Thu, 15 Oct 1992 17:26:00 UTC+0100
Organization: Macro32<==>Vmsnet.Internals Gateway
X-Gateway-Source-Info: Mailing List
Lines: 67