Mail Archives: djgpp/1996/11/15/06:44:41
In article <847448023 DOT 11346 DOT 0 AT ciscs19 DOT demon DOT co DOT uk> cs19 AT cityscape DOT co DOT uk (BDC Client Team) writes:
>I recently downloaded a program that had a definition at the start of a
>subroutine. The definition is:
>int p=0,d[4]
> can anyone help me with the right-hand side of the '=' sign ?
This is defining an array of 4 integers. The elements of the array can be
accessed as d[0],d[1],d[2],d[3] (in general, array x[n] is x[0] to x[n-1]).
>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.
If you compile the code with -Wall the compiler should warn you that the array
is unused, it is not part of the compiler or c++ internals.
I suggest a quick look at a few C books to pick up the basics before leaping
into C++ headlong.
Hope this helps
Jon.
- Raw text -