Skip to content

Instantly share code, notes, and snippets.

@mukundraj
Created October 16, 2014 17:45
Show Gist options
  • Save mukundraj/765ad8e7753f4578d666 to your computer and use it in GitHub Desktop.
Save mukundraj/765ad8e7753f4578d666 to your computer and use it in GitHub Desktop.
The C++ code
extern "C" int sum(short len, short *costs) {
int i;
int sum=0;
for (i = 0; i < len; i++) {
sum += costs[i];
}
return sum;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment