ZCX.C(1):webstorm 错误missing C129: missing ';' before 'main'怎么回事啊

C语言常见出错专题总结_百度文库
两大类热门资源免费畅读
续费一年阅读会员,立省24元!
C语言常见出错专题总结
上传于||文档简介
&&C​语​言​常​见​出​错​专​题​总​结
阅读已结束,如果下载本文需要使用0下载券
想免费下载更多文档?
定制HR最喜欢的简历
下载文档到电脑,查找使用更方便
还剩6页未读,继续阅读
定制HR最喜欢的简历
你可能喜欢c语言错误TEXT1.C(7): error C129: missing ';' before 'char'_百度知道
c语言错误TEXT1.C(7): error C129: missing ';' before 'char'
P3_5)/nms延时程序voiddisplay();&#47,ad_data3;/sbit eoc=P3^0;a&10;通道号显示加一if(number&gt,0x60;unsinged char code tab[]={0x03;/}}}voiddisplay(){uchara,0x09};//芯片启动程序voidkey(),0x9f;nms延时程序voiddelaynms(uint x){&#47,ad_data1;//调显示}}/读得的数据乘以2再乘以98%再分出个位for(a=0,0x25,ad_data2!P3_5);/&#47#include&//&#47,0x0d,0x40;//while(,0x49!eoc);//8)number=1;st=0;&#47,m=1;&#47.5是否按下{delaynms(20);送整数显示P0_7=0;// st=1;25)/送小数点后第二位显示P2=0x07;//显示程序void ad0809();送相关通道数组oe=0;125;点亮第三个数码管小数点P2=0x0d;/ad_data1=(ad_;&#47。5是否按下{while(;//以下三条指令为起动AD0809st=0,0x1f;25)%100)%10);///unsinged char code td[]={0x00;/P1=0x00;///while(1){ad0809();选通第二个数码管delaynms(3);送小数点后第一位显示P2=0x0b;unsinged char x[8];///while(x--&}}voidkey(){if(;//调AD0809启动子程序key();等待转换结束oe=1;送通道号显示P2=0x0e;//读得的数据乘以2再乘以98%再分出十位ad_data3=(((ad_;delaynms(1);读得的数据乘以2再乘以98%除以100得百位ad_data2=((ad_;#define unsigned char #define uint unsigned intsbit st=P3^2;/八通道数据待存数组void delaynms(uint x),0x01!P3_5)&#47。5为高电平number++;i++){;P0=tab[ad_data2];//m++;选通第一个数码管delaynms(3);/取出读得的数据x[m]=P2;8;/10;//}}voidad0809(){uchari,0x30;/延时判误if(;&#47,0x10;reg51;for(i=0;0){for(i=0;////delaynms(3);sbit oe=P3^1;/把相关通道数据给ad_0809display();再一次判断P3;P0=tab[ad_data1];i&lt,0x99;P0=tab[number];i++){P0=td[i],0x70};/a++){P0=tab[ad_data3];/键扫描程序main(){ number=1,0x50;/调按键子程序ad_0809=x[number];选通通道oe=0;/P3;unsinged intad_0809,number,0x41;i&lt,0x20;25)%100)//选通第三个数码管delaynms(3);100.h&gt,ad_data0;/等待P3
我有更好的答案
,不是unsinged看准了!一个分不给unsigned
啊哥哥!,!
其他类似问题
为您推荐:
等待您来回答
下载知道APP
随时随地咨询
出门在外也不愁新手!keil 51异常:error C129 :missing''before 'a&#x27
&来源:读书人网&【读书人网():综合教育门户网站】
新手求助!!keil 51错误:error C129 :missing&#x27&#x27before &#x27a&#x27我想把LED.c中的变量‘a’定
新手求助!!keil 51错误:error C129 :missing';'before 'a'我想把LED.c中的变量‘a’定义成外部变量,以便被工程中的其他文件共享,但在调试时,出现了如标题所示的报警信息。我的LED.c文件和LED.h文件分别如下(源程序全部是在英文状态输入的):LED.C源程序:#include&&reg52.h&#include&&TimerT0.h&&&&//定时器中断程序的头文件&#include&&Typedef.h&&&&//类型定义头文件sbit&led_0=P0^0&;&&&&&&uint&a;/*LED闪烁函数*/void&led_display(){if&(sys_flag_500ms&==&1)&&&/*500ms时间到。时标sys_flag_500ms&由定时器中断产生*/{sys_flag_500ms&=&0&;/*时标清零*/led_0&=&~led_0&;&&&&/*LED以0.2Hz的频率闪烁&*/&&&&&&&&&&&&&&&&&&a++;&&&&&&&&&&&&&&&}}LED.h文件:#ifndef&_LED_H_#define&_LED_H_extern&void&led_display();extern&uint&a;#endif说明:1)除了LED.C文件和LED.h文件外,还有另外几个文件,共同组成一个完整的LED闪烁程序,在此篇幅所限没贴出。2)在没有加入uint&a;和ertern&uint&a;之前,整个程序是正常工作的3)但是在加入uint&a;和ertern&uint&a;之后,程序就会出现:error&C129&:missing';'before&'a'&的报警信息,同时我也详细检查过,绝不是在‘a’的前面缺少了‘;’。非常感谢有高人指点,不胜感激!
[解决办法]uint&没有定义。在LED.h中#include&&Typedef.h&&//类型定义头文件[解决办法]试一下在LED.h头文件中添加uint的宏定义。或者如2楼所说添加那个头文件。[解决办法]sbit&led_0=P0^0&;&&&感觉你的这个分号像是全角字符得用英文半角[解决办法]If&you&don't&want&to&change&LED.h,&you&can&try&to&change&the&way&you&include&header&files&in&main.c,&like&the&following:#include&&reg52.h&#include&&timerT0.h&#include&&typedef.h&#include&&led.h&------解决方案--------------------
头文件的顺序。。。。。如果它们没有依赖性就无所谓,否则被引用的要放在前面。小白求教啊。 【error C129: missing ';' before 'char'】_c语言吧_百度贴吧
&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&签到排名:今日本吧第个签到,本吧因你更精彩,明天继续来努力!
本吧签到人数:0成为超级会员,使用一键签到本月漏签0次!成为超级会员,赠送8张补签卡连续签到:天&&累计签到:天超级会员单次开通12个月以上,赠送连续签到卡3张
关注:456,044贴子:
小白求教啊。 【error C129: missing ';' before 'char'】收藏
一个单片机控制LED灯的程序。包括了数码管显示和按键输入网上COPY的程序。实在看不出哪里有错。各位大神看看有没有哪些粗浅的错误。#include "reg51.h"Unsigned char code changled[10]={0x3f,0x06,0x5b,0x4f,0x66,0x6d,0x7d,0x27,0x7f,0x6f}//共地接的LEDunsigned char led[6];//用来显示用的unsigned char guandeng[3];//关开灯的时间unsigned char kaideng[3];//灯开灯的时间unsigned char present_time[3];//灯开灯的时间unsigned char xiao[3];//灯关小的时间unsigned char flash=0;//片选扫描多少时间换一个位显示unsigned char timemeasure=0;//T1中断次数计算
40*20=1秒unsigned char flash_cs=0;//片选哪个位sbit dadeng=P1^4;//灯关小一点的控制sbit xiaodeng =P1^5;////灯大的控制aunsigned char tiaozheng=0;//调整灯关开暗的状态bit enablebit=0;unsigned int enabletime=0;sbit P1_0 =P1^0;sbit P1_1 =P1^1;sbit P1_2 =P1^2;sbit P1_3 =P1^3;/////调整时间
1为调整目前的时间,2为调整关灯时间,3为调整秒 voidchange_data(unsigned char i) { unsigned char x, if(i==1)
{ x=present_time[0]; change=x/100; x=present_time[0]; led[0]=x/10-change*10; x=present_time[0]; led[1]=(unsigned char)(x-change*100-led[0]*10); x=present_time[1]; change=x/100; x=present_time[1]; led[2]=x/10-change*10; x=present_time[1]; led[3]=(unsigned char)(x-change*100-led[2]*10); x=present_time[2]; change=x/100; x=present_time[2]; led[4]=x/10-change*10; x=present_time[2]; led[5]=(unsigned char)(x-change*100-led[4]*10);
} if(i==2)
{ x=kaideng[0]; change=x/100; x=kaideng[0]; led[0]=x/10-change*10; x=kaideng[0]; led[1]=(unsigned char)(x-change*100-led[0]*10); x=kaideng[1]; change=x/100; x=kaideng[1]; led[2]=x/10-change*10; x=kaideng[1]; led[3]=(unsigned char)(x-change*100-led[2]*10);
x=kaideng[2]; change=x/100; x=kaideng[2]; led[4]=x/10-change*10; x=kaideng[2]; led[5]=(unsigned char)(x-change*100-led[4]*10);
{ x=guandeng[0]; change=x/100; x=guandeng[0]; led[0]=x/10-change*10; x=guandeng[0]; led[1]=(unsigned char)(x-change*100-led[0]*10); x=guandeng[1]; change=x/100; x=guandeng[1]; led[2]=x/10-change*10;
《盗墓笔记》十年之约,震撼揭秘真实地下世界
x=guandeng[1]; led[3]=(unsigned char)(x-change*100-led[2]*10); x=guandeng[2]; change=x/100; x=guandeng[2]; led[4]=x/10-change*10; x=guandeng[2]; led[5]=(unsigned char)(x-change*100-led[4]*10);
} }/***********改变灯的状态*****************************/void change_deng(unsigned i){ if(i==0) { dadeng=1; xiaodeng=0; } if(i==1) {
xiaodeng=1; } if(i==2) {
xiaodeng=0; }}/***********秒分时进初始化*****************************/void init(void){ guandeng[0]=6;//6:00:00 guandeng[1]=0; guandeng[2]=0; kaideng[0]=18; kaideng[1]=0; kaideng[2]=0; present_time[0]=12; present_time[1]=00;
present_time[2]=00; xiao[0]=23; xiao[1]=00; xiao[2]=00;}/*********************定时器0************************/T0_in() interrupt 1 using 3{
flash++; enabletime++; if(flash==15)
if(flash_cs==0)
if(flash_cs==1)
if(flash_cs==2)
if(flash_cs==3)
if(flash_cs==4)
if(flash_cs==5)
bb=led[flash_cs];
if(flash_cs!=5)
flash_cs++;
flash_cs=0;
} if(enabletime==555) {
enabletime=0;
enablebit=1; }}/***********************定时器1**************************/T1_in() interrupt 3 using 3{TH1=()/256;//40MS中断一次TL1=()%256;TR1=1;timemeasure++;/***********秒分时进判断钟*****************************/if(timemeasure==25)//40*50=1s{ timemeasure=0; if(present_time[2]&59)
present_time[2]++;
present_time[2]=0;
if(present_time[1]&59)
present_time[1]++;
present_time[1]=0;
if(present_time[0]&23)
present_time[0]++;
present_time[0]=0;
} if(tiaozheng&=3)
{ change_data(1);
if(present_time[0]==guandeng[0])
if(present_time[1]==guandeng[1])
if(present_time[2]==guandeng[2])
xiaodeng=0;
if(present_time[0]==kaideng[0])
if(present_time[1]==kaideng[1])
if(present_time[2]==kaideng[2])
xiaodeng=1;
if(present_time[0]==xiao[0])
if(present_time[1]==xiao[1])
if(present_time[2]==xiao[2])
xiaodeng=1;
}}main(){unsigned char dengstate=0;//灯的状态P3=0;P1=0x00;ET0=1;ET1=1;TMOD=0x12;TH0=0;TL0=0;TR0=1;TH1=()/256;//20MS中断一次TL1=()%256;TR1=1;EA=1;init();change_data(1);init();// initt();for(;;){/*大小灯转换*/ if(P1_3==1) if(enablebit==1) { enablebit=0; enabletime=0; change_deng(dengstate); if(dengstate&2) dengstate++;
dengstate=0; }//////////调整时间if(P1_0==1) if(enablebit==1) { enablebit=0; enabletime=0;
tiaozheng++; if(tiaozheng&0) if(tiaozheng&=3)
change_data(1);
if(tiaozheng&3)
if(tiaozheng&=6)
change_data(2);
if(tiaozheng&6)
if(tiaozheng&=9)
change_data(3);
if(tiaozheng==10)
tiaozheng=0;
if(tiaozheng==1 || tiaozheng==4 ||tiaozheng==7)
if(tiaozheng==2 || tiaozheng==5 || tiaozheng==8)
if(tiaozheng==3 || tiaozheng==6 || tiaozheng==9)
P3=4; }if(P1_2==1) if(enablebit==1) {
enablebit=0; enabletime=0; if(tiaozheng ==1)
if(present_time[0]&23)
present_time[0]++;
present_time[0]=0;
change_data(1);
} if(tiaozheng ==2)
if(present_time[1]&59)
present_time[1]++;
present_time[1]=0;
change_data(1);
} if(tiaozheng ==3)
if(present_time[2]&59)
present_time[2]++;
present_time[2]=0;
change_data(1);
}//开灯时间调整 if(tiaozheng ==4)
if(kaideng[0]&23)
kaideng[0]++;
kaideng[0]=0;
change_data(2);
} if(tiaozheng ==5)
if(kaideng[1]&59)
kaideng[1]++;
kaideng[1]=0;
change_data(2);
} if(tiaozheng ==6)
if(kaideng[2]&59)
kaideng[2]++;
kaideng[2]=0;
change_data(2);
if(tiaozheng ==7)
if(guandeng[0]&23)
guandeng[0]++;
guandeng[0]=0;
change_data(3);
} if(tiaozheng ==8)
if(guandeng[1]&59)
guandeng[1]++;
guandeng[1]=0;
change_data(3);
} if(tiaozheng ==9)
if(guandeng[2]&59)
guandeng[2]++;
guandeng[2]=0;
change_data(3);
} }if(P1_2==1) if(enablebit==1) {
enablebit=0; enabletime=0; if(tiaozheng ==1)
if(present_time[0]&23)
present_time[0]++;
present_time[0]=0;
change_data(1);
} if(tiaozheng ==2)
if(present_time[1]&59)
present_time[1]++;
present_time[1]=0;
change_data(1);
} if(tiaozheng ==3)
if(present_time[2]&59)
present_time[2]++;
present_time[2]=0;
change_data(1);
}//开灯时间调整 if(tiaozheng ==4)
if(kaideng[0]&23)
kaideng[0]++;
kaideng[0]=0;
change_data(2);
} if(tiaozheng ==5)
if(kaideng[1]&59)
kaideng[1]++;
kaideng[1]=0;
change_data(2);
} if(tiaozheng ==6)
if(kaideng[2]&59)
kaideng[2]++;
kaideng[2]=0;
change_data(2);
if(tiaozheng ==7)
if(guandeng[0]&23)
guandeng[0]++;
guandeng[0]=0;
change_data(3);
} if(tiaozheng ==8)
if(guandeng[1]&59)
guandeng[1]++;
guandeng[1]=0;
change_data(3);
} if(tiaozheng ==9)
if(guandeng[2]&59)
guandeng[2]++;
guandeng[2]=0;
change_data(3);
} }/////////////////////////////////if(P1_1==1) if(enablebit==1) {
enablebit=0; enabletime=0; if(tiaozheng ==1)
if(present_time[0]&=1)
present_time[0]--;
present_time[0]=23;
change_data(1);
} if(tiaozheng ==2)
if(present_time[1]&=1)
present_time[1]--;
present_time[1]=59;
change_data(1);
} if(tiaozheng ==3)
if(present_time[2]&=1)
present_time[2]--;
present_time[2]=59;
change_data(1);
}//开灯时间调整 if(tiaozheng ==4)
if(kaideng[0]&=1)
kaideng[0]--;
kaideng[0]=23;
change_data(2);
} if(tiaozheng ==5)
if(kaideng[1]&=1)
kaideng[1]--;
kaideng[1]=59;
change_data(2);
} if(tiaozheng ==6)
if(kaideng[2]&=1)
kaideng[2]--;
kaideng[2]=59;
change_data(2);
if(tiaozheng ==7)
if(guandeng[0]&=1)
guandeng[0]--;
guandeng[0]=23;
change_data(3);
} if(tiaozheng ==8)
if(guandeng[1]&=1)
guandeng[1]--;
guandeng[1]=59;
change_data(3);
} if(tiaozheng ==9)
if(guandeng[2]&=1)
guandeng[2]--;
guandeng[2]=59;
change_data(3);
贴那么长的代码不是强 奸眼睛么
掉了分号呗。。
你知道你错在哪里吗?最大的错就是空行太大了,我今晚闲着没事在这看程序,你的我看不清。。。哈哈
登录百度帐号推荐应用
为兴趣而生,贴吧更懂你。或CPasswordDialog * m_pModallessD为什么不能被识别 非模态对话框_百度知道
CPasswordDialog * m_pModallessD为什么不能被识别 非模态对话框
h(21) :CPasswordDialog&#39: missing ' g: error C2501;vc--------------------C: error C2501;vc.h(21) : error C2143;mymfc\mymfcview: MYMFC - Win32 Debug-------------------- Compiling.; before &#39. MYMFC: &#39:&#92.mfc视频教程\mymfcview: missing storage-class or type specifiers g:\ : 'mymfc&#92.mfc视频教程&#92.h(21) :\*''m_pModallessDlg&#39.;mymfc\ ;mymfcview.mfc视频教程&#92.cpp g
h&quot:OnNomodalless() { /MYMFCV}CMYMFCVCreate(IDD_PASSWORD_DIALOG; m_pModallessDlg-&PasswordD&#47#include &quot: add construction code herem_pModallessDlg=NULL;#include &ShowWindow(SW_SHOW);stdafx.h&#include &quot:CMYMFCView(){ / TODO; CMYMFCView:.h&quot.h& TODO:;&#47:~CMYMFCView(){if(m_pModallessDlg==NULL)delete m_pModallessD}void CMYMFCV} m_pModallessDlg-&gt: Add your command handler code hereif(m_pModallessDlg==NULL){ m_pModallessDlg=new CPasswordDMYMFCD#include &quot.h&quot,this);/#include &quot:;/MYMFC
我的意思是说不要在:~CMYMFCView()中的if();::OnNomodalless() 中CPasswordDialog *m_pModallessDCreate(IDD_PASSWORD_DIALOG;/&#47,this);号的话;Create(IDD_DIALOG1;m_pModallessDlg-&gt:。有方法的,如果你确信没有少一个&&,建议不要定义成成员变量;PasswordD放在出现这种错误;并去掉CMYMFCVm_pModallessDlg-&这里假设CPasswordDialog的ID是IDD_DIALOG1 PS;m_pModallessDlg=new CPasswordDialog。然后将包含#include &quot.cpp文件的最上面:CMYMFCView()中的if(m_pModallessDlg=NULL.;m_pModallessDlg-&gt.这句和CMYMFCView.然后在void CMYMFCView。可以在该对话框关闭时进行释放;ShowWindow(SW_SHOW).h&quot。那么可能是重复包含或包含的顺序不对的原因;m_pModallessDlg=new CPasswordD这样做的问题只是堆中的m_pModallessDlg的空间释放的问题:。CPasswordDialog *m_pModallessDlg.h文件里定义 CPasswordDialog *m_pModallessDlg,this)!你这用的是非模态对话框
我知道你的那种方法行得通,我就想知道我的这种错误的原因在哪,而且我的这种也是行得通的
这个问题我也遇到过的。在网上找过很多方法,自己也试了很多种。经验就是1.所有没有定义成员变量的并要包含使用该代码的,#include放在.cpp中。2.如果有定义成成员变量的(一定要放在.h中包含),你可以试着将文件头的几个包含文件改变一下包含的顺序。这样也许就可以了。
这个我也经试过了,但好像还是不能解决问题,不过还是很感谢你热心的回答
来自团队:
其他类似问题
为您推荐:
非模态对话框的相关知识
其他1条回答
把非模态对话框的父窗口设为屏幕。Create( IDD_DIALOG, GetDesktopWindow() );
在具体点吧,我还不是很懂啊
等待您来回答
下载知道APP
随时随地咨询
出门在外也不愁}

我要回帖

更多关于 missing before 的文章

更多推荐

版权声明:文章内容来源于网络,版权归原作者所有,如有侵权请点击这里与我们联系,我们将及时删除。

点击添加站长微信