Static Variables in Overloaded Functions
Posted
by BSchlinker
on Stack Overflow
See other posts from Stack Overflow
or by BSchlinker
Published on 2010-06-14T07:27:01Z
Indexed on
2010/06/14
7:32 UTC
Read the original article
Hit count: 300
I have a function which does the following:
- When the function is called and passed a true bool value, it sets a static bool value to true
- When the function is called and passed a string, if the static bool value is set to true, it will do something with that string
Here is my concern -- will a static variable remain the same between two overloaded functions? If not, I can simply create a separate function designed to keep track of the bool value, but I try to keep things simple.
© Stack Overflow or respective owner