Pointer equal in C : I know normally, * and & signs. But our teacher gives us an example and she said "Problem occurs here"

   

    int *a1;
    int *a2 = new int[100];
    a1=a2 //What does this line mean???
    delete []a2;
    
    k=a1[0]//she said error occurs here.


I couldn't understand what is a1 = a2 ?
and why does error occur?

