🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.std.c++
Article #2714

Re: Array Initialization

#2714
From: Ken Walter
Date: Thu, 23 Nov 1995 15:21
40 lines
2132 bytes
In message <48t9t7$5c2@engnews1.eng.sun.com> - clamage@Eng.Sun.COM
(Steve Clamage) writes:
:>
:>In article 41C67EA6@ecid.cig.mot.com,
:>Joe Walker <walkerjj@ecid.cig.mot.com> writes:
:>>Has allowing the following been considered?
:>>
:>>  int  length = strlen (some_string);
:>>  char buffer [ length ];
:>>
:>>I.E. allowing non const array sizing.
:>
[...]
:>
:>The standard could say that an implemention is allowed to simulate
:>variable-sized stack or static arrays by using the heap and automatically
:>deallocating the storage. IMHO that is not acceptable because in
:>portable code you would not know whether a declaration like
:>	char buffer[length];
:>could fail. It also could turn what looks like a simple declaration into
:>a heavy-weight operation.

It would be a very strange machine which could not handle it.  We did it, 
trivally, in the 60's with quite ordinary machines, NO heavy weight operation.
Not any worse than running out of stack space at a procedure call with C now!
C and C++ ignored many of the very useful features of Fortran and Algol 
learned back then.  C and C++ are still a very high level assembly language
with an awful declaration syntax!

[...]
:>Steve Clamage, stephen.clamage@eng.sun.com
:

Ken Walter

* All the above is hearsay and the opinion of nobody in particular
---
[ comp.std.c++ is moderated.  Submission address: std-c++@ncar.ucar.edu.
  Contact address: std-c++-request@ncar.ucar.edu.  The moderation policy
  is summarized in http://dogbert.lbl.gov/~matt/std-c++/policy.html. ]
Technical Details
Message-ID: <491vrk$qe8@news.gate.net>
Path: arc1-ca.pugleaf.net!in1.uu.net!bounce-back
References: <30B1CB7E.41C67EA6@ecid.cig.mot.com>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!in1.uu.net!bounce-back
Date: 23 Nov 95 15:21:41 GMT
Approved: fjh@cs.mu.oz.au
From: solution@gate.net (Ken Walter)
Newsgroups: comp.std.c++
Subject: Re: Array Initialization
X-Original-Date: 23 Nov 1995 14:18:28 GMT
Organization: Solution Technology
Message-ID: <491vrk$qe8@news.gate.net>
References: <30B1CB7E.41C67EA6@ecid.cig.mot.com>
X-Newsreader: NeoLogic News for OS/2 [version: 4.2]
X-Auth: PGPMoose V1.1 PGP comp.std.c++
 iQBFAgUBMLSRm+EDnX0m9pzZAQGvgQF/bD/GxoqY8poNdDG6GCB5Uoe9C9rAJNcy
 Xb6OtEd7wWyp7BxROrFqYrHFVDp4Mz/D
 =J8OO