home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #23 / NN_1992_23.iso / spool / vmsnet / internal / 1463 < prev    next >
Encoding:
Internet Message Format  |  1992-10-15  |  3.2 KB

  1. Path: 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
  2. From: REGI's <NUNEZ@esevvx.cica.es>
  3. Newsgroups: vmsnet.internals
  4. Subject: (None)
  5. Message-ID: <01GPZHTP9W4G0001ZZ@esevvx.cica.es>
  6. Date: Thu, 15 Oct 1992 17:26:00 UTC+0100
  7. Organization: Macro32<==>Vmsnet.Internals Gateway
  8. X-Gateway-Source-Info: Mailing List
  9. Lines: 67
  10.  
  11. >X-Envelope-to: MACRO32@WKUVX1.bitnet
  12. >X-VMS-To: IN::"MACRO32@WKUVX1.BITNET"
  13.  
  14. 1
  15. 12-OCT-1992 12:48:33.64
  16.    1 00:00:00.00
  17. 13-OCT-1992 12:48:33.64
  18. @UKCC.uky.edu:MacroMan@WKUVX1.BITNET
  19. gutier@SEVAXU.CICA.ES
  20.  
  21. Received: from UKCC.uky.edu by ESEVVX.CICA.ES ;  9-OCT-1992 12:48:16.08
  22. Received: from ukcc.uky.edu by UKCC.uky.edu (IBM VM SMTP V2R2)
  23.    with BSMTP id 3044; Fri, 09 Oct 92 07:47:08 EDT
  24. Received: from WKUVX1.BITNET by ukcc.uky.edu (Mailer R2.08) with BSMTP id 5377;
  25.  Fri, 09 Oct 92 07:47:07 EDT
  26. Errors-To: MacroMan@WKUVX1.BITNET
  27. X-ListName: "VMS Internals, MACRO, and BLISS Discussions"
  28.     <MACRO32@WKUVX1.BITNET>
  29. Received: from CUNYVM.BITNET (MAILER) by WKUVX1 (MX V3.1C) with BSMTP; Fri, 09
  30.           Oct 1992 06:44:20 CDT
  31. Received: from CUNYVM by CUNYVM.BITNET (Mailer R2.08) with BSMTP id 2623; Fri,
  32.           09 Oct 92 07:41:54 EDT
  33. Received: from KOPC by CUNYVM.CUNY.EDU (IBM VM SMTP V2R2) with TCP; Fri, 09 Oct
  34.           92 07:41:31 EDT
  35. Received: from DECNET-MAIL (ARNE@KO) by kopc.hhs.dk (PMDF #3400 ) id
  36.           <01GPQTVHA7W08WW0VG@kopc.hhs.dk>; Fri, 9 Oct 1992 12:40:55 +0100
  37. Date: 09 Oct 1992 12:40:54 +0100
  38. From: Arne Vajhxj <ARNE@ko.hhs.dk>
  39. Reply-To: MACRO32@WKUVX1.BITNET
  40. Subject: Re: C Language question
  41. To: MACRO32 <MACRO32@WKUVX1.BITNET>,
  42.     NRA%ipg.ph.kcl.ac.uk@nsfnet-relay.ac.uk
  43. Message-ID: <01GPQTVHA7W28WW0VG@kopc.hhs.dk>
  44. X-VMS-To: KOPC::IN%"@cunyvm.cuny.edu:MACRO32@WKUVX1.BITNET"
  45. X-VMS-Cc: IN::"NRA%ipg.ph.kcl.ac.uk@nsfnet-relay.ac.uk"
  46. MIME-version: 1.0
  47. Content-type: TEXT/PLAIN; CHARSET=ISO-8859-1
  48. Content-transfer-encoding: 8BIT
  49.  
  50. > Question: in C, if one declares char a[I][J], is there anything in the
  51. > language standard that guarantees that &a[0][0] is the first of a set of
  52. > I*J contiguous chars, and that a[i+1][0] is guaranteed to be the same
  53. > storage location as a[i][J] ).
  54. >
  55. > A friend asserts that it is, and says his experience on several systems
  56. > 'proves' this. My belief is that there is nothing that says this will
  57. > always be the case, and that the only constraint is that every valid pointer
  58. > a[i] will point to J chars. Which of us is right?
  59.  
  60. I think your friend is rigth (a[I][J] would be I*J contigious bytes), but
  61. I can not prove it, but ...
  62.  
  63. The arguments are:
  64.   1)  As your friend has observed C-compilers tend to do it that way.
  65.   2)  The creative way C lets you manipulate arrays, pointers and
  66.       addresses must somehow assume, that they are stored contigious.
  67.   3)  It is most efficient that way (simpler address calculations).
  68.  
  69. But to be absolutely certain you will need to check the real sources:
  70. K&R and the ANSI specifications.
  71.  
  72.                                                           Arne
  73.  
  74. Arne Vajhxj                             local DECNET:  KO::ARNE
  75. Computer Department                     PSI:           PSI%23831001304030::ARNE
  76. Business School of Southern Denmark     Internet:      ARNE@KO.HHS.DK
  77.  
  78.