Sum of elements in array

Hello, guys. I am interested to sum the elements in array. How can I do that?

a for loop?

This is C++ not APL, so there is no +/array operator.

int s = 0;
for (i=0; i< ARRAY_SIZE; i++)
    s += array[i];
int myArray[10];
unsigned int index;
long arraySum;

arraySum = 0;
for(index = 0; index < sizeof(myArray)/sizeof( myArray[0]); index++)
{ arraySum += myArray[index]; }

You need to have a good idea of the range of numbers you are summing. In this I have assumed that the sum can exceed the range of 'int’s and so the sum is defined as long. Also I have assumed the number of array elements is within the range of an unsigned int index (probably a safe assumption given the typical amount of memory in most devices)
I must admit that, unless I have misinterpreted your question, if you need help with something like this, then you probably need to get a good book on introductory C programming as this really is very basic stuff and you will have all sorts of problems later on with whatever you are actually doing.