-1

I get an Undefined reference error when trying to compile this code.

#include <stdio.h>

int power(int m, int n);

int main()
{
    printf("%d", power(2,5));
    return 0;
}

1 Answers1

2

You declared power but you need to implement it.

#include <stdio.h>

int power(int m, int n)
{
  .. your code goes here
}

int main()
{
    printf("%d", power(2,5));
    return 0;
}
Jabberwocky
  • 48,281
  • 17
  • 65
  • 115