title: Using a variable in multiple Cpp files
body: <p>I am working with an Arduino project in Atmel studios. I need to declare, initialize and use an int in one section of code (settings.cpp/settings.h) and also use it in another .cpp file (error.cpp). I was wondering what the best way to do this is. </p>
  
  <p>My plan was to declare the int as an extern int in settings.h, initialize it in settings.cpp and then #include settings.h in error.cpp. </p>
  
  <p>I'm just wondering if this is the best way to best way to do this or do I need to consider anything when giving error.cpp access to settings.h</p>
  
  <p>Thanks.   </p>