> > Funny you should say that. Pointers are exactly what you want.
> >
> > Make your function take a pointer to the struct type.
>
> yeah i was trying to make a joke :) guess someone got it.
>
> i did use ptrs and it worked great, saved 2600 bytes, made the code
> easier to read. i was just unsure about it as i seem to remember
> someone recently saying that structs shouldnt be passed in function
> parameters.
by using pointers you just pass the "memory" location, not the
entire structure.. hence it is more effecient.
why not use structs?
1) limited stack space on Palm (4Kb or something)
- if you start passing large structures.. expect to run out
of stack space quickly.
2) gcc developers
- the compiler uses the "bcopy()" routine to handle the
memory copy for the stack.. if you dont have your own
bcopy() routine, and DONT link with -static.. expect
C library errors (as it is not a PalmOS function).
gcc works fine of course.. once you figure out all the little
obscurities behind how to use it properly.. this is one of them,
but you can always do a small function that called MemCopy
defined as bcopy(). :>
:) cheers.
az.
--
Aaron Ardiri
Lecturer http://www.hig.se/~ardiri/
University-College i G�vle mailto:[EMAIL PROTECTED]
SE 801 76 G�vle SWEDEN
Tel: +46 26 64 87 38 Fax: +46 26 64 87 88
Mob: +46 70 352 8192 A/H: +46 26 10 16 11