Hi

Make it global, i.e. declare it outside any class in a .h file or in a dedicated .h file. Place extern int MyVar in cpp file where you need this variable. Or place this statement in a dedicated .h file. You must only be sure that you DECLARE your variable once.

HTH

Yves Le Sant
Metrology and Measurement Unit
Fundamental and Experimental Aerodynamics Departement
ONERA Meudon
(Office National d'Etudes et de Recherches Aérospatiales)
FRANCE