Global Variables
-
Hey Guys How do i get global variables available in all files of project. For instance i declare a global variable in a header and then include that header in everything that i want to acces the global variable but that doesn't work so how exactly do i go about doing it so i can have a program wide global accesable from any cpp file. Peter
-
Hey Guys How do i get global variables available in all files of project. For instance i declare a global variable in a header and then include that header in everything that i want to acces the global variable but that doesn't work so how exactly do i go about doing it so i can have a program wide global accesable from any cpp file. Peter
-
Define the variables above the main () in your main.cpp source. Declare the variables as "extern" in your other header files. Done.
Cheers Works buetifully Peter