k**f 发帖数: 372 | 1 Although it is an implementation detail, the fact that size of a valarray
can be determined at runtime indicates that the underlying memory of
valarray is very likely to be allocated on heap, not on stack. So the size
of a valarry variable may not be directly related to the size of the data
inside it. So I'd say use the valarry directly. You may try to initiate a
very big valarry to see if there's any stack overflow issue. At least some
compiler will complain when it happens.
Good luck. |
|