C Programming help .....
Vu Pham
vu
Tue Jan 25 11:05:22 PST 2005
> -----Original Message-----
> From: linux-users-bounces at linux-sxs.org
> [mailto:linux-users-bounces at linux-sxs.org] On Behalf Of Roger
> Oberholtzer
> Sent: Tuesday, January 25, 2005 9:57 AM
> To: Linux tips and tricks
> Subject: Re: C Programming help .....
>
> On Tue, 2005-01-25 at 16:43, Roger Oberholtzer wrote:
>
> Sorry, but the last two parameters to memset are the other way around.
> Put the calue to set the memory to second, and the amount to set last.
>
> > memset(&A_TEST_MENU, sizeof(struct _extended_menu), 0);
> >
> > The sizeof() part can also be a variable name if it is a constant
> > size,
> > like:
> >
> > memset(&A_ARRAY_MENU, sizeof(A_ARRAY_MENU), 0);
I guess you are also a PalmOS programmer :-)
When I did an app port from PalmOS to CE, I did a #define MemSet to be
memset and forgot the reversed order of arguments. It went crazy .
Vu
More information about the Linux-users
mailing list