New1.c(49): error C267: 'rrc': requires ANSI-style prototype

封尘浪 2013-04-16 08:35:16

/*--------------------------------------------------------------------------------------
* Project: New1.c
* Name: zwp
* Date: 2013.3
*--------------------------------------------------------------------------------------*/


#include <REG51.h>
#include <stdio.h>

typedef unsigned char uchar;
typedef unsigned int uint;

uchar rcc(uchar ch, uchar num);

void delay(uint number);


uchar rcc(uchar ch, uchar num)
{
uchar tbite, tbitl;

tbite = ch << (8 - num); // left remove
tbitl = ch >> num; // right remove
ch = tbitl|tbite;

return ch;
}


void delay(uint number)
{
while(number--);
{
// empty
}
}


int main(void)
{
uchar index, temp;
uint jun;

P1 = 0xff;

for(index = 0, temp = 0xfe; index < 8; index ++)
{
P1 = rrc(temp, index);
delay(100);
}

return 0;

}


New1.c(49): error C267: 'rrc': requires ANSI-style prototype;

编译时出现错误: 要求ANSI风格的原型 ,我检查没错啊? 请求前辈指点!
...全文
7257 2 打赏 收藏 转发到动态 举报
写回复
用AI写文章
2 条回复
切换为时间正序
请发表友善的回复…
发表回复
封尘浪 2013-04-16
  • 打赏
  • 举报
回复
哎,太粗心了,以后要好好检查程序! 非常感激前辈指点,谢谢
dceacho 2013-04-16
  • 打赏
  • 举报
回复
仔细看 rcc,rrc 那个错误是说你的rrc未定义

27,508

社区成员

发帖
与我相关
我的任务
社区描述
硬件/嵌入开发 单片机/工控
社区管理员
  • 单片机/工控社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧