'How to create a dynamic array to pass into function that takes in `int64_t const *` type?
I'm working with a codebase where there's a function with the following declaration:
int process(int64_t const *dimensions, int64_t size);
I'm working with a function that calls process and the argument that I pass into process is an array of dimensions, but the size of the array can only be determined at runtime, all the values are the same.
I need a way to write
int64_t dimensions[N] = {1};
where N is determined at runtime. Is there a possible way to do this and have it be compatible with the parameter for process?
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
