[an error occurred while processing this directive]
|
class D
{
public:
D (int init) : loc (init) {;}
void PrintSt () {printf ("%d\n", st);}
void PrintLoc () {printf ("%d\n", loc);}
protected:
private:
static int st;
int loc;
};
int D::st = 1234;void main ()
{
D a(10), b(15);
a.PrintSt(); a.PrintLoc();
b.PrintSt(); b.PrintLoc();
}Перменная st зашарена между всеми экземплярами D
Составить ответ ||| Конференция ||| Архив
Ответы
E-mail: info@telesys.ru