static variable in C++

Hi guys.

In java, there is a static variable that is common to all the class members (that is, a single memory segment that is refereed from all the class members. Is there anything similar in c++?

thanks.
yes. it's pretty much exactly the same
Yes, and they are almost identical to those declared in Java (both in declaration and in the way they behave). For more information regarding static variables in C++, refer to the following article:

http://www.cprogramming.com/tutorial/statickeyword.html
Got it.

Thanks
What you should have done, and maybe should do in the future, is explain the behavior in Java so that a wider audience can help you. Not all of us are familiar with Java.
I was sure I did.

I read alexdlaird link and it should be, pretty much exactly the same.
I wasn't sure if you were referring to a static member variable or the this->pointer in C++.
Topic archived. No new replies allowed.