fork download
#include 

// using namespace std; // avoid this, especially at global scope

// use whitespace to make it more readable
void print_array( const int arg[], int length, char seperator )
{
    int i = 0 ;
    for(  ; i < length-1 ; ++i )
        std::cout << arg[i] << seperator ;
    if( length > 0 ) std::cout << arg[i] ; // print the last element
}

// seperate words in identifiers with an _  (or change of case)
int add_array( const int arg[], int length ) // make it const-correct
{
    int sum = 0 ; // give this a more intuitive name
    for( int i=0; i
				
				
				
				
				
				
			
Success #stdin #stdout 0s 2852KB
stdin
Standard input is empty
stdout
5+5+5+5 == 20
6+16+26+36+46+56 == 186