expected identifier or '(' before '&' token

场景:expected identifier or ‘(’ before ‘&’ token 函数返回引用如何解决

求助:expected identifier or ‘(’ before ‘&’ token 函数返回引用怎么解决?
如下代码,在return t; 下面一空行报错:expected identifier or ‘(’ before ‘&’ token,怎么查都看不出哪里有格式问题:
C/C++ code
#include <stdio.h>
#include <stdlib.h>

int &func(int& t)
{
  return t;
[color=#FF0000]  //This line: expected identifier or ‘(’ before ‘&’ token[/color]
}


int main(int argc, char * argv[]) {
    
      int a=0;
      int b=func(a);
      printf("&a=0X%08X,&b=%08X\n",&a,&b);

    return 0;
}

把函数换成如下也是同样的错误:
C/C++ code
int &func(int* t)
{
  return *t;
    //This line: expected identifier or ‘(’ before ‘&’ token
}


我用的是WinGW+eclipse+gcc,在eclipse里编译如上代码,或者命令行里用gcc编译都是报一样的错:
expected identifier or ‘(’ before ‘&’ token

请大家帮忙看下这个错在哪里,怎么解决?谢谢^-^

------解决方案--------------------
楼主应该用g++来编译吧。
------解决方案--------------------
换成下面两种写法之一看看?
C/C++ code

#include <stdio.h>
#include <stdlib.h>

int func(int& t)
{
  return t;
}


int main(int argc, char * argv[]) {
    
      int a=0;
      int b=func(a);
      printf("&a=0X%08X,&b=%08X\n",&a,&b);

    return 0;
}