Yahoo Groups archive

AVR-Chat

Index last updated: 2026-04-28 22:41 UTC

Message

Re: Arrays and pointers in GCC

2009-01-12 by mikehg_67

--- In AVR-Chat@yahoogroups.com, "David VanHorn" <microbrix@...> wrote:
>
> Is there a reason that I can't use a char as a pointer in an array
of ints?

An actual pointer you can't but it looks like the pointer you're
referring to is just an index so yes you can use a char but most
compilers are going to promote a char to an integer when doing
arithmetic. You can sometimes override the promotion but it can get
ugly. Usually you need to add "& 0xff" and char casts to do this.

Mike H.

Attachments

Move to quarantaine

This moves the raw source file on disk only. The archive index is not changed automatically, so you still need to run a manual refresh afterward.