cvs.gedasymbols.org/archives/browse.cgi   search  
Mail Archives: djgpp/1997/02/06/03:10:27

From: "John M. Aldrich" <fighteer AT cs DOT com>
Newsgroups: comp.os.msdos.djgpp
Subject: Re: Question on pointers and arrays
Date: Wed, 05 Feb 1997 20:33:41 -0800
Organization: Two pounds of chaos and a pinch of salt
Lines: 18
Message-ID: <32F95F25.3032@cs.com>
References: <32f92a6c DOT 0 AT ntnews DOT compusmart DOT ab DOT ca>
Reply-To: fighteer AT cs DOT com
NNTP-Posting-Host: ppp103.cs.com
Mime-Version: 1.0
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp

Demandred wrote:
> 
> If I declare an array of objects of type Foo
> And pass a pointer to a Foo into a function (or class constructor)
> Can I access elements in the array in the function, like so?
> 
> ...array[3]...}

Yes.  Passing a pointer and an array are identical constructs, as long
as you aren't dealing with multi-dimensional arrays.  Those start to get
more fun.  :)

-- 
---------------------------------------------------------------------
| John M. Aldrich, aka Fighteer I |        fighteer AT cs DOT com          |
| Proud owner of what might one   |   http://www.cs.com/fighteer    |
| day be a spectacular MUD...     | Plan: To make Bill Gates suffer |
---------------------------------------------------------------------

- Raw text -


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