Hello,
Thanks for responses, but I think I need to make our problem a little
clearer. I am using several .cpp files in my project. I would like to have
one header file that contains all my function prototypes. This has been
working great until I tried to prototype a function that has a structure
data type as one of its parameters. I tried what Ralph suggested and it
works just fine but that is not what I am trying to do. What I have done to
get around this is to prototype the function in the files that will use the
function. This seems to work. But again its not the way I would like to do
it.
Thanks,
Alex
----- Original Message -----
From: <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Saturday, October 23, 1999 7:38 PM
Subject: Re: Passing structures to new functions
>
>
> 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
>
>
>
>
>
>
>
>