[Linker error] undefined reference to `cube(int*, int)' in Dev C++

Hi
I was trying to run a code below and I get the error message as above.
I tried on Visual C++ - no luck.
Any hints?
Thanks

// Change the contents of an array using a function

#include <iostream>
using namespace std;

void cube(int *n, int num);

int main()
{
int i, nums[10];

cout <<"Orginal contents: ";
for(i=0; i<10; i++) nums[i] = i+1;
cout << "\n";

cube (nums, 10);

cout <<"\n";
cout << "Altered contents: ";
for(i=0; i<10; i++) cout <<nums[i] << ' ' ;


system ("pause");
return 0;
}
You have not defined the cube() function, you've only declared it.
Thanks very much.
I copied this code from the book I learning from and I thought that cube() is a part of one of libraries.
No, and besides, even if it were, it would not be part of iostream, the only header you include.
Topic archived. No new replies allowed.