next up previous
Next: How do I derive Up: class and struct Previous: When should I use

How do I call a static member outside a class?

struct A
{
  static int	id;
  static int	genId() { return id++; }
};

int     function()
{
  A::id = 0;          // call to a static attribute
  return A::gendId(); // call to a static method
}



Alexis Angelidis (PhD) 2005-01-11