L
Lalatendu Das
I have seen a header file in which one structure is defined with
extern declaration in a header file and declared one variable of that
structure in one C-file. The code goes as mentioned below . I am
confused with the way it is declared and defined.
a.h
-------
:
:
:struct abc {
unsigned long a;
unsigned long b;
};
extern struct abc abc;
:
:
file.c
-------
:
#include <a.h>
:
:
struct abc abc;
:
:
Here in the above example I am confused about, what extra the coder
going to achieve by declaring it as extern in the header file a.h.
Thanks
Das
extern declaration in a header file and declared one variable of that
structure in one C-file. The code goes as mentioned below . I am
confused with the way it is declared and defined.
a.h
-------
:
:
:struct abc {
unsigned long a;
unsigned long b;
};
extern struct abc abc;
:
:
file.c
-------
:
#include <a.h>
:
:
struct abc abc;
:
:
Here in the above example I am confused about, what extra the coder
going to achieve by declaring it as extern in the header file a.h.
Thanks
Das