--- Mike <[EMAIL PROTECTED]> wrote:
>
> typedef struct _MyIrEvent{
>       IrEvent IrEvt;
>       UInt16 test;
> } MyIrEvent;
> 
> MyIrEvent *MyIrEvt;  // I have also tried _MyIrEvent *MyIrEvt
> 
> static void DoIR(MyIRC, MyIrEvt) {
>       switch(MyIrEvt->IrEvt) {    // this won't compile
>               case LEVENT_DATA_IND:
>                 break;
>         // more case stuff below
> }
> 
> The error is "pointer/array required."  I have tried casting the
> MyIrEvt within the switch statement back to the structure and it 
> still gives the error.  ???
> 

I admit that I don't know all of the arcane details of C.  (How can I
bother when I regularly have to program in 5 or 6 different languages,
out of about 15 or so I use occaisionally?) 

However, this:

> MyIrEvent *MyIrEvt;  // I have also tried _MyIrEvent *MyIrEvt
> static void DoIR(MyIRC, MyIrEvt) {

looks bad.

Why not use:

 static void DoIR(SomeType MyIRC, MyIrEvent *MyIrEvt) {

Then, the compiler should know that MyIrEvt is a pointer to a MyIrEvent
structure.  If you don't specify a type, I believe that C defaults to
using int, and since an int isn't a pointer, you get the "pointer/array
required" error when you refer to MyIrEvt->IrEvt.


__________________________________________________
Yahoo! - We Remember
9-11: A tribute to the more than 3,000 lives lost
http://dir.remember.yahoo.com/tribute

-- 
For information on using the Palm Developer Forums, or to unsubscribe, please see 
http://www.palmos.com/dev/support/forums/

Reply via email to