This is sdrawkcab.

In the .H file:

    extern int my_variable;

In one -- and only one -- of the .C or .CPP files:
    int my_variable;

The first tells everyone that there will be an variable
with the name "my_variable" available for use, but
does not allocate any memory for the value.  The
keyword "extern" is a msg to the compiler that says
"don't worry about it, it's the linker's job".

The second actually allocates the storage for
"my_variable".  This must be done once only!
The linker will then match up this allocated memory
with all uses of "my_variable" in the other modules.

--
-Richard M. Hartman
[EMAIL PROTECTED]

186,000 mi/sec: not just a good idea, it's the LAW!

[EMAIL PROTECTED] wrote in message <[EMAIL PROTECTED]>...
>
>Hi,
>I think you should define the variable in one of the .H and then in the
other
>file write
>
>     extern  varaible_type    varaiable_name.
>Bye,
>          Raffaella
>
>
>
>





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

Reply via email to