(1) The use of new and delete is simple:
int * a = new int[10];
delete[] a; a = 0; // Free space
(2) The template is written as follows:
template <typename T>
void Sort(T arr[], int n)
{
}
(3) Structure exchange is almost the same as ordinary variable exchange
void swapstruct(student& a, student& b)
{
student t = a;
a = b;
b = t;
}