suggest use: double *tptr = new double[n]if you use malloc(), you must tell which kind of type you want to convert.
suggest use new and delete in C++:
double *tptr = new double[n];
...
delete tptr;
呵呵,malloc比new更有效率
new(int n)
{
void *p = malloc(n * sizeof(object));
for i = 0 to n
{
p[i]->constructor();
}
}
{
void *p = malloc(n * sizeof(object));
for i = 0 to n
{
p[i]->constructor();
}
}
