• C

static variables in threads

If a static variable is declared within a function that is called by multiple threads, I would think the static variable would be shared among threads - e.g. it is not thread safe.  Am I correct about this?
chsalviaAsked:
Who is Participating?

Improve company productivity with a Business Account.Sign Up

x
 
sunnycoderConnect With a Mentor Commented:
Hi chsalvia,

Yes you are correct.

Cheers!
sunnycoder
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.