   global variable doesn't work
  Hii have the following problemdefs.hstatic float testTick;Gamemain.cppmain()testTick = GetTickCount(); //Now the variable has a valueclass TestTick{  public:    UseTick() {float i = testTick; };//This compiles and run but i will always be 0    //Why ????????} 
  1) What language?  C++? 2) Post real code, not fragments.  How is class TestTick used?3) Post this type of stuff in the Beginners Forum.Regards,Jeff    [ Little Devils Inc. ] ;  A "static float" will be defined in each translation unit that defines it, as separate copies.You probably want to declare it "extern" instead of static, and then define it in one (and only one) translation unit. "Translation unit" usually means "One .cpp file and all it includes"; i e, one invocation of the compiler on a specific file.In defs.h:extern float testTick;In some-file.cpp:float testTick;In all files:#include "defs.h"void myfunc() {  testTick = 3;};  Thanks!   [edited by - wonderworld on February 19, 2004 10:53:15 AM]