主题:[讨论]动态数组定义的麻烦!
请各位大仙帮忙分析这个问题
//定义动态数组
typedef double* DoublePtr;
DoublePtr d;
d=new double[10]; //--------(173)
---
---
---
delete [] d;
错误
(173): error C2501: 'd' : missing storage-class or type specifiers
(173) : error C2040: 'd' : 'int' differs in levels of indirection from 'double *'
(173) : error C2440: 'initializing' : cannot convert from 'double *' to 'int'
This conversion requires a reinterpret_cast, a C-style cast or function-style cast
//定义动态数组
typedef double* DoublePtr;
DoublePtr d;
d=new double[10]; //--------(173)
---
---
---
delete [] d;
错误
(173): error C2501: 'd' : missing storage-class or type specifiers
(173) : error C2040: 'd' : 'int' differs in levels of indirection from 'double *'
(173) : error C2440: 'initializing' : cannot convert from 'double *' to 'int'
This conversion requires a reinterpret_cast, a C-style cast or function-style cast