www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1997/02/06/10:28:12

From: kagel AT quasar DOT bloomberg DOT com
Date: Thu, 6 Feb 1997 10:04:38 -0500
Message-Id: <9702061504.AA26325@quasar.bloomberg.com >
To: demandrd AT compusmart DOT ab DOT ca
Cc: djgpp AT delorie DOT com
In-Reply-To: <32f92a6c.0@ntnews.compusmart.ab.ca> (demandrd@compusmart.ab.ca)
Subject: Re: Question on pointers and arrays
Reply-To: kagel AT dg1 DOT bloomberg DOT com

   From: demandrd AT compusmart DOT ab DOT ca (Demandred)
   Date: Thu, 06 Feb 1997 00:47:46 GMT

   Probably a silly question, but...

   If I declare an array of objects of type Foo

   Foo FooArray[5];

   And pass a pointer to a Foo into a function (or class constructor)

   Bar(Foo *array) {...

   Can I access elements in the array in the function, like so?

   ...array[3]...}

Yup, exactly.

-- 
Art S. Kagel, kagel AT quasar DOT bloomberg DOT com

A proverb is no proverb to you 'till life has illustrated it.  -- John Keats

- Raw text -


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