// Array.cpp : Defines the entry point for the console application.
//
#include "stdafx.h"
#include <stdio.h>
#include <iostream.h>
class A{
private:
static A* const pa;
A(){}
public:
static A* const GetA(){
return pa;
}
void hello() {
cout<<"Hello!"<<endl;
}
};
A* const A::pa=new A();
//const static A pa;
int main(int argc, char* argv[])
{
A* pa=A::GetA();
pa->hello();
}
// Array.cpp : Defines the entry point for the console application.
//
#include "stdafx.h"
#include <stdio.h>
#include <iostream.h>
class A{
private:
static A* const pa;
A(){}
public:
static A* const GetA(){
return pa;
}
void hello() {
cout<<"Hello!"<<endl;
}
};
A* const A::pa=new A();
//const static A pa;
int const getConstA(){
return 1;
}
int getConstB(){
return 1;
}
int main(int argc, char* argv[])
{
const int a=getConstA();
const int b=getConstB();
int c=getConstA();
int d=getConstB();
A* pa=A::GetA();
pa->hello();
}