+ 1
How can we add the elements of an array?
2 Answers
+ 2
if they're numbers then you can do
int temp;
for (int i=0,i <sizeof (array)/sizeof (array [0]);++i)
temp+=array [i];
+ 2
If you want your array can be resized adding new items at runtime, you must use dynamic arrays to can resize it.
Sample:
int *array = new int[10];