delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/2000/01/30/20:33:36

From: "Andrew Hurrell" <andrew AT amh-consulting DOT freeserve DOT co DOT uk>
Newsgroups: comp.os.msdos.djgpp
Subject: Re: how do I use 2D variables
Date: Sun, 30 Jan 2000 00:37:03 -0000
Organization: Customer of Planet Online
Lines: 36
Message-ID: <872lf8$top$1@newsg3.svr.pol.co.uk>
References: <8722e8$res$1 AT zingo DOT tninet DOT se> <3894BC87 DOT 8ED55889 AT geocities DOT com>
NNTP-Posting-Host: modem-10.keyhole-butterfly.dialup.pol.co.uk
X-Trace: newsg3.svr.pol.co.uk 949279016 30489 62.137.35.10 (31 Jan 2000 00:36:56 GMT)
NNTP-Posting-Date: 31 Jan 2000 00:36:56 GMT
X-Complaints-To: abuse AT theplanet DOT net
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 5.00.2014.211
X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2014.211
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp
Reply-To: djgpp AT delorie DOT com

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