hi,

tnx for your answer.
i use a share .h file but it's still doesn't work i guess i'll try again.

bye :-)
"Fitzpatrick, Joe" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
>
> I'm not completely sure I understand you problem - but here are some
> generalities:
>
> If you are create a new data type (typdef or C++ class), the definition
has
> to be included by all source files that use the type.  So, generally the
> definition goes in a shared .h file.
>
> If you are sharing a global variable between files (not a great idea, but
> that is a huge subject) ONE source file (.c/.cpp) must instantiate the
> variable, all other source files that need the variable must include an
> 'extern' declaration for the variable.
>
> File1.cpp:
>    mytype MyPublicVariable;
>
> File2.cpp:
>    extern mytype MyPublicVariable;
>
> There are games you can play with header files and defines to cut down on
> repetition but, from the compiler's point of view the situation remains
the
> same.
>
> Good Luck,
> -jjf
>
> -----Original Message-----
> From: Eliah Ninyo [mailto:[EMAIL PROTECTED]
> Sent: Sunday, November 05, 2000 1:08 PM
> To: Palm Developer Forum
> Subject: i have problem with my project...
>
>
> hello,
>
> i have a project with two files: file1.cpp and file2.cpp. i also have a
> header file, lets call it hand.h (in addition for the resources header
> file).
>
> i define a type def structure at file1. i needed the structure to be known
> at file2, so i put it un my header file - hand.h.
> i have in file2 line code in one of my function that looks like that:
>
> return strctP->field;
>
> strctP is define like this:
>
> mystructure *strctP;  // as a pointer to my structure
>
> field is one of the field in my struct.
>
> for some resone i get an error on this line (  - "return ...") saying "
> identifier expected".
>
> i really don't know what to do, why doesn't the '->' work?
>
>
> by the way, i use Code Warrior 6R.
>
> i hope some1 will know the answer because i real stuck.
>
> tnx :-)

> byeeeee
>
>
> --
> ELIAH NINYO
>
> [EMAIL PROTECTED]
>
>   ("`-''-/").___..--''"`-._
>   `6_ 6  )   `-.  (     ).`-.__.`)
>    (_Y_.)'  ._   )  `._ `. ``-..-'
>  _..`--'_..-_/  /--'_.' ,'
> (il).-''  (li).'  ((!.-'
>
>
>
> --
> For information on using the Palm Developer Forums, or to unsubscribe,
> please see http://www.palmos.com/dev/tech/support/forums/
>
>





-- 
For information on using the ACCESS Developer Forums, or to unsubscribe, please 
see http://www.access-company.com/developers/forums/

Reply via email to