动态内存分配与回收
#include <iostream>
using namespace std;
int main()
{
int i,j;
int * array = NULL;
cin >> i;
array = new int [i];
for(j=0;j<i;j++)
cin >> array[j];
for(j=0;j<i;j++)
cout << array[j] << " ";
delete(array);
return 0;
}
c : malloc free
c++ : new delete