+ 2

Dynamic allocation basic(help)

what is benefit of dynamic allocation on this code.I can get user input at run time and print the output.in this program whether memory is deleted or not after close the program . https://code.sololearn.com/ctteq9dGFx3n/?ref=app

24th May 2018, 4:11 AM
Bahubali
Bahubali - avatar
1 Resposta
+ 6
Note that some compilers do not allow variables in place of array size for array declaration. int a[n]; Instead: int* a = new int[n]; is universally accepted.
24th May 2018, 5:22 AM
Hatsy Rei
Hatsy Rei - avatar