I can't seem to find anything regarding whether or not this is possible. Ideally I'd have someone input an integer like "4" and then it would make a 4-d array.
is this at all possible?
I can't seem to find anything regarding whether or not this is possible. Ideally I'd have someone input an integer like "4" and then it would make a 4-d array.
is this at all possible?
As explained in the Stack Overflow post, "Create an N dimensional array, where N is determined at runtime (C++)":
The dimensions of an array are part of the type, and the type must be known
at compile time.
Thus the programmer must specify the dimensions of the array before compile-time
, not during run-time
.
Type checking
is typically one of the first operations a compiler does (it is specifically found in the semantic analysis
portion of the compiler's control flow) to ensure the code received is free of simple programming errors (assignment/equivilance errors, etc).
Please let me know if you have any questions!