How do I use extern to share variables between source files? | C2C Community

How do I use extern to share variables between source files?

  • 2 September 2022
  • 1 reply
  • 12 views

I know that global variables in C sometimes have the extern keyword. What is an externcorewalking variable? What is the declaration like? What is its scope?

This is related to sharing variables across source files, but how does that work precisely? Where do I use extern?


This topic has been closed for comments

1 reply

Userlevel 7
Badge +13

Hello, @roywilliq32 and welcome to C2C!
 

First things first, please present yourself to our community in the C2C Lounge using this template. It would be great to get to know you better.

Secondly, we are the Google Cloud Customer Community and your post above is not related to Google Cloud or any of its technologies. Therefore, I have to close this topic. Please post topics related to Google Cloud and its technologies.

 

Thank you kindly for your understanding.