Since declaration line gives segfault, isn't it probably because of stackoverflow?
Theoritically there can't be a stack over flow in my scenario.
As per my knowledege, structure definition is cross checked and read during compilation, whether it is through header file or else defined inside the C source file.
Now, can this difference affect the program execution?...me not sure.
Or else is it something like that compiler stores structure definition of header in some other way, and that of C source in some different way; due to which during runtime it creates conflict??
There's no difference at all. Putting struct definition in header file is to share struct definition across source files. It's the C pre-processor that include contents of #include to source files.Or else is it something like that compiler stores structure definition of header in some other way, and that of C source in some different way; due to which during runtime it creates conflict??
Compilation phases