You are not allocating nothing in there. The line double y_OUT[nrow] = {};
contains two errors. As described by the error messages.
nrow
is notconstexpr
. It cannot be evaluated at compile time.- by the braces initializer you suggest the vector has
0
elements, it does not make sense either.
The proper syntax for dynamic allocation is: double* y_OUT = new double[nrow];
. I think that is what you wanted. The syntax you used double y_OUT[nrow]
is for used for static allocation, in other words where the size of array must be known at compile time.
Sidenotes: Of course you need to remember to free the memory you reserve. And the problem is totally unrelated to the topic IMO =)