www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1996/11/08/07:18:27

Date: Fri, 8 Nov 1996 03:57:35 -0800 (PST)
From: Samuel Vincent <svincent AT cs DOT sonoma DOT edu>
To: BDC Client Team <cs19 AT cityscape DOT co DOT uk>
cc: djgpp AT delorie DOT com
Subject: Re: Help with Definition: int p=0,d[4]
In-Reply-To: <847448023.11346.0@ciscs19.demon.co.uk>
Message-ID: <Pine.GSO.3.94.961108035611.26318A-100000@zippy>
MIME-Version: 1.0

On Fri, 8 Nov 1996, BDC Client Team wrote:

> I am very new to c++ and am attempting to learn it in the usual way - download
> other peoples programs, examine the code, work out what it does, chang it to see 
> what happens, etc.
> 
> I recently downloaded a program that had a definition at the start of a
> subroutine.  The definition is:
> 
> int p=0,d[4]
> 
> It is obviously defining an integer variable 'p' and assigning a start value
> to it - can anyone help me with the right-hand side of the '=' sign ?  
> There is no reference to a variable 'd' in the rest of the code, so I assume 
> that, in this case, 'd'is recognized by the compiler as a function/constant 
> of some kind.
> 
> None of my books contain anything even vaguely resembling this, so any help would
> be gratefully received !
> 
> Many Thanks
> 
> Neil

This code merely declares an integer p, assigning it 0, and then declares
d to be an array of 4 integers, uninitialized.  I asume there is a
semicolon at the end of that line or somewhere before the next piece of
code.

-Sam


- Raw text -


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