Search code examples
cexternf2c

Extern struct in C


I have a C file generated with f2c (Fortran to C translator) that contains the following C structure:

struct {
    real rez, pi, st;
} const_;

How can I declare this const_ variable as an external in another .c file without modifying the one generated by f2c?


Solution

  • In another file.

    extern struct {
        real rez, pi, st;
    } const_;