0

hi
please I want sm to tell me about the signification of the following expression:
std::complex<float> (*W)[M] = &Z[k][0];

knowing the following declarations:
Z[N][P][M];
et 0 <= k < N

thanks for answer

2
Contributors
1
Reply
2
Views
9 Years
Discussion Span
Last Post by vijayan121
0
[B]std::complex<float> Z[N][P][M] ;[/B]
[B]Z[/B] is an array of [B]N[/B] elements,
    each element of which is an array of [B]P[/B] elements,
        each element of which is an array of [B]M[/B] elements,
            each element of which is a [B]std::complex<float>[/B]

std::complex<float> (*W)[M] = &Z[k][0] ;

W is a pointer to an array of M elements, each of which is a std::complex<float>

&Z[k][0] is the address of an array of M elements, each element being a std::complex<float>. this address is used to initialize W.

that is the meaning of the statement (incidentally, int i = 100 ; is *not* an expression.)
what its significance is, or why someone would want to do this, i have no idea.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.