All pastes #871583 Raw Edit

robin

public cpp v1 · immutable
#871583 ·published 2008-01-25 01:16 UTC
rendered paste body
#include "stdafx.h"#include <iostream>using namespace std;class A {protected:	static char* a;public:	static void test();};class B:A {  public:    static char* a;};char* A::a = "A::a";char* B::a = "B::a";void A::test() {	cout << A::a << endl; // Prints 'A::a'	cout << B::a << endl; // Prints 'B::a' - B::a is a separate entity from A::a (unlike in PHP - see: http://pastebin.ca/871556)}int _tmain(int argc, _TCHAR* argv[]) {	A::test();	    return 0;}