hi do someone know how to delcare a "program global" int,string...
i have some int's and string's in a cpp file but i like to use the same variables other cpp file how i do make that
Surely thats breaking encapsulation, and as its been said before on here that generally makes bugs harder to track down?? Can you not just pass them as parameters??
Heres me saying all this and I have numerous statics globally available, but only through methods !!!
the keyword is extern.. you define the variable in, say, main.cpp normally, then in the other files you say "extern int i;" or whatever the variable's type and name are