[Freeciv-Dev] Re: (offtopic) C subscripts; was Re: Compiler-warnings
[Top] [All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
On Wed, 24 Jan 2001, dwpfitzner@xxxxxxxxx wrote:
> Raimar Falke <hawk@xxxxxxxxxxxxxxxxxxxxxxx> wrote: >
>
>> [ Negative subscript values? Is this a gnu extension? What are the
>> semantics?
>
> Negative subscript values have just the same semantics as
> non-negative ones -- its just pointer arithmetic:
> a[b] = *(a + b)
Incidentally, this means that [] is abelian:
int
main (int argc, char *argv[])
{
printf("The third letter of the alphabet is %c.\n", 2["ABC"]);
}
--
Big Gaute http://www.srcf.ucam.org/~gs234/
Impudent.. Yet possessing a certain ALUMINUM SILICATE
overbite....Needs REDDY-WHIP!!
- [Freeciv-Dev] Re: (offtopic) C subscripts; was Re: Compiler-warnings, David Pfitzner, 2001/01/24
- [Freeciv-Dev] Re: (offtopic) C subscripts; was Re: Compiler-warnings, Dirk Stoecker, 2001/01/25
- [Freeciv-Dev] Re: (offtopic) C subscripts; was Re: Compiler-warnings, Reinier Post, 2001/01/25
- [Freeciv-Dev] Re: (offtopic) C subscripts; was Re: Compiler-warnings, Dirk Stoecker, 2001/01/26
- [Freeciv-Dev] Re: (offtopic) C subscripts; was Re: Compiler-warnings, Reinier Post, 2001/01/26
- [Freeciv-Dev] Re: (offtopic) C subscripts; was Re: Compiler-warnings, Gaute B Strokkenes, 2001/01/27
- [Freeciv-Dev] Re: (offtopic) C subscripts; was Re: Compiler-warnings, Raimar Falke, 2001/01/27
- [Freeciv-Dev] Re: (offtopic) C subscripts; was Re: Compiler-warnings, Gaute B Strokkenes, 2001/01/27
- [Freeciv-Dev] Re: (offtopic) C subscripts; was Re: Compiler-warnings, Raimar Falke, 2001/01/27
- [Freeciv-Dev] Re: (offtopic) C subscripts; was Re: Compiler-warnings, Gaute B Strokkenes, 2001/01/27
[Freeciv-Dev] Re: (offtopic) C subscripts; was Re: Compiler-warnings,
Gaute B Strokkenes <=
|
|