힙에할당된변수 포인터안써도 접근할수잇다는데

예제가

int *ptr=new int;

int &ref*ptr;

ref=20;

cout<<*ptr<<endl;

인데

첫번째줄부터 대놓고 포인터쓰는데 어찌함