I have a variable that I would like to use in all my classes without needing to pass it to the class constructor every time I would like to use it. How would I accomplish th
if you want to declare it in different header files/cpp files, just declare it extern outside of other files
extern
//file1.c int x=1; int f(){} //file2.c extern int x;