Global variables in Legato framework

My main.c file executes a function which is present in another .c file

the functions returns a value which is present in same function file

I want to access this value in main.c through a header file. Do you have any sample example for this? somehow i am not able to takeout the values from another file to main.c

I am connecting both the files over a common header file

Are the two files in the same application?

You can put the variable in main.c file, and then other file declares extern variable of the same variable naming

For example: