错误:在'&'令牌之前应有';',','或')' [英] error: expected ‘;’, ‘,’ or ‘)’ before ‘&’ token

查看:44
本文介绍了错误:在'&'令牌之前应有';',','或')'的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在此行的C头文件中收到此错误:

I get this error in a C header file in this line :

char * getFechaHora(time_t & tiempoPuro);

在C源代码文件中,我包括头文件并为该函数提供实现

In a C source code file i am including the header file and giving the function an implementation

char * getFechaHora(time_t &tiempoPuro){...}

我的头文件中也正确包含了"time.h"库.

also in my header file i am including correctly the "time.h" library.

推荐答案

在C语言中,如果char * getFechaHora,这是您的函数,并且两个(time_t& tiempoPuro)是参数,则应将该函数声明为:

In C, if char * getFechaHora, this is your function and the two (time_t & tiempoPuro) are arguments you should declare the function as:

char * getFechaHora(*type* time_t, *type* tiempoPuro);

否则,如果第二个是变量,则声明为

else if the second is a variable, declare as

char * getFechaHora(time_t *tiempoPuro);

这篇关于错误:在'&'令牌之前应有';',','或')'的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆