I'm trying to create a very simple function in c++ however I keep getting a "Link error".
My code:
#include <iostream>
using namespace std ;
int fun(int,int);
main(){
int width,height,w,h,mult;
cin>>width;
cin>>height;
mult = fun(width,height);
int fun(int w,int h);{
w * h ;
}
cout << mult ;
}
The error:
[Linker error] undefined reference to `fun(int, int)'
ld returned 1 exit status