0
Follow
0
View

How to solve the problem of #c++#?

csf211289 注册会员
2023-02-27 19:15

(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;
}

About the Author

Question Info

Publish Time
2023-02-27 19:15
Update Time
2023-02-27 19:15