请教大家,为什么我用DEV-C++写函数那章时,写用书上的例子时通过不了,不知为什么
											
程序代码:#include<stdio.h>
int main()
{
      int i=2,p;
    
      p=f(i,++i);
      printf(" %d ",p);
    
      }
      int f(int a,int b)
      {
          int c;
          if(a>b) c=1;
          else if (a==b)c=0;
          else c=-1;
          return(c);
          }
      在这句子出错,“p=f(i,++i);”报6 D:\c语言\
D:\c语言\8.18.8.4.cpp In function `int main()':
8.18.8.4.cpp `f' undeclared (first use this function)
(Each undeclared identifier is reported only once for each function it appears in.)
D:\c语言\8.18.8.4.cpp In function `int f(int, int)':
11 D:\c语言\8.18.8.4.cpp `int f(int, int)' used prior to declaration
不知那里出错了,,,,请教大家帮帮我,。谢谢!



											
	    

	