Hi I a have created a global.h file in which I define enum Token I get the garbage value of token if I use the value of Token other than glabal.cpp file I have also include the "global.h" file in other file where I am using the Token value how can I correct this problem.
+1
A:
If I am correct in assuming that your problem is that you don't want to include global.h in each of your files...
You need to include the enum in any source file you use it from. You cannot forward declare an enum.
Brian R. Bondy
2010-04-01 19:38:43
i am including global.h in all files where i am using Token enum but i get the garbage value for token
Faisal Arshad
2010-04-03 20:47:08