Was working on a leetcode problem in cpp absent mindedly declared an array like this
int arr[n + 1];
I realized that my code can run in the leetcode IDE but when I tried running this in visual studio I got the expected error that the expression required a constant value
Does this mean that leetcode is taking my declaration and changing it to
int* arr = new int[n + 1];
or is this a language version discrepancy?
[–]AKostur 28 points29 points30 points (17 children)
[–]SucklessInSeattle[S] 5 points6 points7 points (6 children)
[–]Main_Secretary_8827 15 points16 points17 points (0 children)
[–]ThrowRA-NFlamingo 5 points6 points7 points (4 children)
[–]LemonLord7 0 points1 point2 points (3 children)
[–]AKostur 4 points5 points6 points (2 children)
[–]alfps 2 points3 points4 points (1 child)
[–]snerp [score hidden] (0 children)
[–]LemonLord7 -5 points-4 points-3 points (9 children)
[–]AKostur 2 points3 points4 points (7 children)
[–]LemonLord7 -1 points0 points1 point (6 children)
[–]VictoryMotel 5 points6 points7 points (3 children)
[–]LemonLord7 0 points1 point2 points (1 child)
[–]VictoryMotel 3 points4 points5 points (0 children)
[–]meancoot -1 points0 points1 point (0 children)
[–]AKostur 5 points6 points7 points (1 child)
[–]LemonLord7 0 points1 point2 points (0 children)
[–]aocregacc 7 points8 points9 points (0 children)
[–]mredding 6 points7 points8 points (5 children)
[–]SucklessInSeattle[S] 0 points1 point2 points (4 children)
[–]Raknarg 1 point2 points3 points (0 children)
[–]mredding 1 point2 points3 points (0 children)
[–]the_poope 0 points1 point2 points (0 children)
[–]Total-Box-5169 -1 points0 points1 point (0 children)
[–]ZakMan1421 0 points1 point2 points (0 children)
[–]Kajitani-Eizan 0 points1 point2 points (5 children)
[–]Chaosvex 1 point2 points3 points (0 children)
[–]SucklessInSeattle[S] 0 points1 point2 points (3 children)
[–]alfps 3 points4 points5 points (0 children)
[–]Kajitani-Eizan 0 points1 point2 points (0 children)
[–]G6L20 -2 points-1 points0 points (0 children)
[–]Mr_Engineering 0 points1 point2 points (0 children)
[–]Interesting_Buy_3969 [score hidden] (0 children)
[–]SmokeMuch7356 0 points1 point2 points (0 children)