Re: array questions
- From: Lawrence Kirby <lknews@xxxxxxxxxxxxxxx>
- Date: Sat, 18 Jun 2005 13:29:42 +0100
On Fri, 17 Jun 2005 23:55:58 +0200, Martijn wrote:
>>> char arr[10];
>>>
>>> When we find sizeof(arr) ---> Output is 10, arr is treated as
>>> an object of 10 chars.
>>>
>>> When we say arr+1, ---> arr is treated as a pointer to char.
>>>
>>> Why is this anomalous behaviour ?
>>
>> arr is the address of the first element, arr[0]. arr + 1 is address
>> of second element, arr[1], and so on. What is anomalous about this?
>
> A lot of people forget that sizeof is not a function call, more like an
> operator.
It is precisely an operator.
Lawrence
.
- References:
- array questions
- From: junky_fellow
- Re: array questions
- From: Them
- Re: array questions
- From: Martijn
- array questions
- Prev by Date: Re: quick way to determine the array is irdered?
- Next by Date: Re: array questions
- Previous by thread: Re: array questions
- Next by thread: Re: array questions
- Index(es):
Relevant Pages
|