www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/2000/02/01/18:33:07

From: "Netpower" <kjelke AT netpower DOT no>
Newsgroups: comp.os.msdos.djgpp
Subject: Re: how do I use 2D variables
Date: Tue, 1 Feb 2000 15:59:12 +0100
Organization: NetPower Int AS
Lines: 48
Message-ID: <876scd$jq1$1@news.netpower.no>
References: <8722e8$res$1 AT zingo DOT tninet DOT se> <3894BC87 DOT 8ED55889 AT geocities DOT com> <872lf8$top$1 AT newsg3 DOT svr DOT pol DOT co DOT uk>
NNTP-Posting-Host: np-hana.netpower.no
X-Trace: news.netpower.no 949417165 20289 212.33.133.4 (1 Feb 2000 14:59:25 GMT)
X-Complaints-To: abuse AT netpower DOT no
NNTP-Posting-Date: 1 Feb 2000 14:59:25 GMT
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 5.00.2919.6700
X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2919.6700
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp
Reply-To: djgpp AT delorie DOT com

Hi

Would the new operator work with 2+ dimentional arrays, instead of malloc?
example...


kjell arne

"Andrew Hurrell" <andrew AT amh-consulting DOT freeserve DOT co DOT uk> wrote in message
news:872lf8$top$1 AT newsg3 DOT svr DOT pol DOT co DOT uk...
> Or you could use a multidimensional array
> e.g.
> int a[10][10][10] and reference a[i][j][k]
>
> or use int **a and use malloc to dynamically allocate storage
>
> If you need some storage allocator code - drop me an email
>
> > if i understand correctly:
> >
> > // for 2d
> > struct twoD {
> > int x;
> > int y;
> > };
> >
> > struct threeD {
> > int x;
> > int y;
> > int z;
> > };
> >
> > void main() {
> > twoD a;
> > threeD b;
> >
> > a.x = 10;
> > b.z = 15;
> > }
> >
> > "Börje Granberg" wrote:
> > >
> > > How do I define and use 2D,3D etc. 'var(x,y)' I don't have a clue
>
>
>


- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019