Hi Please delete this message if not appropriate to this forum.
having trouble with defining function. As you can see from the code below I have defined a power function.
#include <stdio.h>
/* simple power program*/
int power (int m, int n);
int main()
{
int i;
for (i=0; i < 10; ++i)
printf ("%d %d %d \n", i, power(2,i), power(-3,i));
return 0;
}
And yet when I build I get:
||=== Build: Debug in Learning C (compiler: GNU GCC Compiler) ===|
obj\Debug\main.o||In function `main':|
C:\Users\Tim\Documents\Source code and programs\Learning C\main.c|12|undefined reference to `power'|
C:\Users\Tim\Documents\Source code and programs\Learning C\main.c|12|undefined reference to `power'|
||=== Build failed: 2 error(s), 0 warning(s) (0 minute(s), 4 second(s)) ===|
Running windows 7 professional service pack 1 with the latest updates.
Any help would be greatly appreciated.
Mephisto
P.S. I have included a screen dump for clarity as well.