is it necessary to delete the array if so then why we are deleting it ?
what is local variable?
Problem related to delete
Hey @vikash3303
No,It’s not necessary to delete the array but it’s considered as a good coding practice in case we need more memory in big codes(Development of something)or similar.
Local variables are variables within a block who will not be considered as soon as their block ends.
For eg
int main(){
int a;
for(int i=0;i<a;i++){
int x=10;
}
}
Here a is local to main() and can be used anywhere within main
x and i are local to that loop because if you try to use it outside the loop it will give u error.
If your doubt is resolved then please mark it so