on-internet
← Community

Array[n] vs Array[10] - Initializing array with variable vs numeric literal

Stack Overflow ·

I am having the following issue with my code: int n = 10; double tenorData[n] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10}; Returns the following error: error: variable-sized object 'tenorData' may not be initialized Whereas using double tenorData[10] works. Anyone know why?

Comments

Sign in or sign up to comment and upvote.

No comments yet.