Thursday, July 9, 2009

Is it possible to declare a static variable in Windows C++ Dll ? (VC++).?

There are 7 functions in dll all functions share same variables. It means if a process calls the 7 functions separately. Then the old values must be preserved.

Is it possible to declare a static variable in Windows C++ Dll ? (VC++).?
not sure if if I am reading the question right, but you can define global and local variables.





global - variable is known throughout the different functions - i.e. declared in main procedure as a global variable





local - can define local variables that are only known within that specific procedure - so outside of this procedure they wouldnt be known.





can also use functions that return the value, so you can call a procedure, and define the parameters you want it to return





hope this has helped





-John
Reply:you can define a global variable, u cannot define a static one as it will be called in non static functions


No comments:

Post a Comment