Hi,
I have a header (call it a.h) file where I declare some variables, such as an int. For example
I have a .c file (call it a.c) that implements the function prototypes of that header file. It also uses those variables for different reasons.Code:int ranks;
In another .c file (call it b.c), I include a.h and and include the a.o when i'm linking.
now, in b.c I want to assign a value to this variable ranks (found in a.h) simply by doing
or something like that. However, when running the code and printing, total_ranks is correct (say 10), but ranks is always 0 when printed in a.c.Code:ranks = total_ranks;
Where should I put this int ranks ??
Thank you!