A
A
avp2018-04-18 08:05:58
C++ / C#
avp, 2018-04-18 08:05:58

How to convert a variable to a constant?

I have an array
extern int vectorSync[]
After some calculations, the size of the array is calculated.
Is written to a variable.
But to declare the size of an array, I need a constant.
How to move the value of a variable into a constant, and then substitute it into the size of an array?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
I
Igor, 2018-04-18
@assembled

It seems to me that in any way, it is better to use a dynamic array.
int *arr = new int [ len ] ;

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question