※ 引述《cocoxyz1129 (老洪)》之銘言:
...
: p=(double***)malloc(n*sizeof(*p));
: *p=(double**)malloc(n*n*sizeof(**p));
: **p=(double*)malloc(n*n*n*sizeof(***p));
: for(i=0;i<n;i++) *(p+i)=*p+i*n;
: for(i=0;i<n;i++) **(p+i)=**p+i*n*n;
p=(double***)malloc(n*sizeof(double**));
*p=(double**)malloc(n*n*sizeof(double*));
**p=(double*)malloc(n*n*n*sizeof(double));
for(i=0; i<n; ++i) ...
for(i=0; i<n*n; ++i) *(*p+i)=**p+i*n;
--
※ 發信站: 批踢踢實業坊(ptt.cc)
◆ From: 114.33.184.50