trying to simplify an algorithm

Hui Zhou zhouhui at
Tue Mar 1 08:00:05 PST 2005

On Tue, Mar 01, 2005 at 11:44:22PM +0800, Andrew Calkin wrote:
>I thought a pointer was a pointer, but C allowed pointer arithmetic.
>That was why when you declare a pointer variable, you need the type
>defined for which the pointer will be used, right? So then the
>pointer arithmetic knows how many bytes are used in e.g. an element
>of an array of characters as opposed to an array of integers or an
>array of floating-point numbers, for example.
>Or am I wrong here?

You are correct :-)
I guess I was thinking something else when I wrote that.

Hui Zhou

More information about the lfs-chat mailing list