• We’re currently investigating an issue related to the forum theme and styling that is impacting page layout and visual formatting. The problem has been identified, and we are actively working on a resolution. There is no impact to user data or functionality, this is strictly a front-end display issue. We’ll post an update once the fix has been deployed. Thanks for your patience while we get this sorted.

C Programming: help with extern structs

Shaka

Senior member
Ok, let's say I have FILE1.C which has:

> struct evnt_struct
> {
> int pid_owner;
> int num_waiting;
> }
>
> struct evnt_struct evnt_array[33];


All that is declared outside a function, therefore evnt_array[33] is global.

Ok, in FILE2.C I have:

> extern struct evnt_struct evnt_array[33];

Doesn't this allow me to use evnt_array[] in FILE2.C? I keep getting this error:

> invalid use of undefined type 'struct evnt_struct'

I'm using Mandrake 8.1, kernel version 2.4.8 Please help!
 
You might need to put:

> struct evnt_struct
> {
> int pid_owner;
> int num_waiting;
> }

in a header file that is included in both ".c" source files.
 
Back
Top