How to make a variable avaliable to multiple .cpp files using a class?
问题 This question has derived from this one. I have a working program which must be split into multiple parts. In this program is needed to use a variable (now it's a GTK+ one :P) many times in parts of the program that will end up in separated .cpp files. So, I made a simple example to understand how to make variables avaliable to the program parts. A modified version of the previous code would be: #include <iostream> using namespace std; int entero = 10; void function() { cout<<entero<<endl; /