Re: array question

From: Ingo Buescher (usenet-2004_at_webmounty.de)
Date: 11/19/04


Date: Fri, 19 Nov 2004 10:53:17 +0100

Indy Tech wrote:

> I have a vague memory of a way to define arrays that they do not contain a
> member array(0), but rather start at 1. Don't even recall what lamguage it
> is from. Can anyone tell me if there is a way to do this in C++?

> JP

>

thinking of something like this?

#include <stdlib.h>
int main(int argc, char *argv[])
{
   int array[10];
   int *ptr = &array[0]-1;
   ptr[1] = 123;
   printf("Result: %i", array[0]);
   return(EXIT_SUCCESS);
}

IB

-- 
===========================================================================
Ingo Buescher <usenet-2004@webmounty.de>
"To get something done, a committee should consist of no more than three
men, two of them absent." -- unknown


Relevant Pages