Array[n] vs Array[10] - Initializing array with variable vs numeric literal
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?
0 upvotes
View original discussion ↗
Comments
Sign in or sign up to comment and upvote.
No comments yet.