Top "Static-members" questions

A static member is a data field that is shared by all instances of a class or structure for the same program.

Static fields vs Session variables

So far I've been using Session to pass some variables from one page to another. For instance user role. When …

c# asp.net .net session-variables static-members
c++ member function access private static variable?

Possible Duplicate: What does it mean to have an undefined reference to a static member? I don't know why I …

c++ static-members
How do static events compare to non-static events in C#?

I just realized static events exist - and I'm curious how people use them. I wonder how the relative comparison …

c# events static-members
How exactly do static fields work internally?

Say you have a class, class Foo { public static bar; } When you say: new Foo(); I can imagine that in …

c# java php oop static-members
Write to static field - is FindBugs wrong in this case?

I have a Java class like this: public class Foo { public static int counter = 0; public void bar(int counter) { Foo.…

java static-methods static-members findbugs
Where are static class variables stored in memory?

This is a follow-up question to How are static arrays stored in Java memory? . So global variables in C/C++ …

java c++ memory static-members class-variables
how to see the values of static variables at runtime in visual studio

The question pretty much explains what I want to do. I have several projects in c# which constitute the solution …

c# visual-studio-2010 runtime static-members
How to have static data members in a header-only library?

What is the best way to have a static member in a non-templated library class, without placing the burden of …

c++ static-members header-only
Access child class static variables from parent class?

I have a base class that I need to call functions on a class that is referenced in the child …

php reference static static-members
What is the correct way to initialize static data members in C++ (98, 11 and 14)

What is the right way to initialize static data members in C++? I'm also interested in how it has changed …

c++ c++11 static-members c++14 c++98