Hmmm you sould distressed. I don't really like helping people who haven't got anything to build on. Here is a small sample:
Code:
// this is all c code
int find_smallest(int *array, int size) {
register int i;
int smallest = 10;
for(i = 0; i < size; i++)
if(array[i] < smallest)
smallest = array[i];
return smallest;
}
int main(int argc, char **argv) {
int array[] = { -1, 2, 3, -3, 7 };
printf("%d", find_smallest(sizeof(array)>>2);
}
I didn't make this code exactly newbie friendly, especially considering the fact that most newbie C++ programmers are affraid of C. Also I put one inhierent flaw in the program. Enjoy.