a simple question# Programming - 葵花宝典
y*h
1 楼
In main function, we can declare an array in two ways:
either
int a[100]; //create an array on the stack
or
int* a=new int[100]; //create an array on the heap
What is the difference between those arrays in terms of performance-
wise ?
When should we use the former, and when to use the latter?
thanks
either
int a[100]; //create an array on the stack
or
int* a=new int[100]; //create an array on the heap
What is the difference between those arrays in terms of performance-
wise ?
When should we use the former, and when to use the latter?
thanks