小弟初学c,有个菜鸟级问题如下:
程序报错内容为
error[000] e:\project\mcu\c test\c.c 16 : not an argument: main
warning[000] e:\project\mcu\c test\c.c 16 : external declaration inside function
error[000] e:\project\mcu\c test\c.c 16 : ; expected
error[000] e:\project\mcu\c test\c.c 17 : { expected
warning[000] e:\project\mcu\c test\c.c 27 : function declared implicit int
warning[000] e:\project\mcu\c test\c.c 34 : unused variable declaration: main (from line 16)
error[000] e:\project\mcu\c test\c.c 35 : no identifier in declaration
warning[000] e:\project\mcu\c test\c.c 35 : missing basic type: int assumed
error[000] e:\project\mcu\c test\c.c 35 : ; expected
error[000] e:\project\mcu\c test\c.c 37 : function redefined: sc
halting build on first failure as requested.
build failed: mon sep 07 23

12 2009
---------------------------------------------------------
#include<pic.h>
#define uchar unsigned char
#define uint unsigned int
__config(0x3b31);
//uchar code table[]={0x3f,0x06,0x5b,0x4f,0x66,0x6d,0x7d,
// 0x07,0x7f,0x6f,0x77,0x7c,0x39,0x5e,0x79,0x71};
void delay(uint x)
{
uint a,b;
for(a=x;a>0;a--)
for(b=110;b>0;b--);
}
void sc()
void main()
{
trisb=0;
trisd=0;
trise=0;
portb=0;
portd=0;
porte=0;
while(1)
(
portb=0x20;//0011 1000
portd=0x01;
sc();
delay(1);
portb=0x10;//0011 1000
portd=0x01;
sc();
delay(1);
}
}
void sc()
{
porte=0x6;
nop();nop();
porte=0x00;
}