Ralf (Ralf Beckers <[EMAIL PROTECTED]>),
Passing a struct to a function is perfectly fine. There's nothing "not possible"
about it.
Palm ("Palm Dev Forum" <[EMAIL PROTECTED]>),
I copied your snippet into a .c file and compiled it in CodeWarrior for Palm OS
R5. It compiled with no errors but with two warnings ("alpha" not initialized
before being used, and "function" needs to return a function result). You might
want to be more explicit about the problems you're having.
-- Keith
Ralf Beckers <[EMAIL PROTECTED]> on 10/23/99 02:23:18 PM
Please respond to [EMAIL PROTECTED]
Sent by: Ralf Beckers <[EMAIL PROTECTED]>
To: [EMAIL PROTECTED]
cc: (Keith Rollin/HQ/3Com)
Subject: Re: Passing structures to new functions
Hi,
Palm Dev Forum wrote:
> I am trying to pass a structure that I defined to another function. When I
> compile using code warrior it tells me that I have an illegal definition in
> my prototype.
This is not possible.
Try passing a pointer to that struct. This will work.
something(alpha *alphaP)
{
alphaP->b[0] = 'B';
}
function()
{
alpha one;
Err err = something(&one);
}
Ralf Beckers