https://en.cppreference.com/w/cpp/numeric/complexArray-oriented access
For any object z of type complex<T>, reinterpret_cast<T(&)[2]>(z)[0] is the real part of z and reinterpret_cast<T(&)[2]>(z)[1] is the imaginary part of z.
For any pointer to an element of an array of complex<T> named p and any valid array index i, reinterpret_cast<T*>(p)[2*i] is the real part of the complex number p[i], and reinterpret_cast<T*>(p)[2*i + 1] is the imaginary part of the complex number p[i]
The intent of this requirement is to preserve binary compatibility between the C++ library complex number types and the C language complex number types (and arrays thereof), which have an identical object representation requirement.
你的问题恐怕是这儿
有问题先查reference
【 在 capriccio 的大作中提到: 】
: int main()
: {
: int n = 8;//n=1时正常,n>1时报异常
: ...................
--
FROM 115.205.70.*