void CTCPDlg::OnChangeEdit1()
{
CString str13;
char cs[100]={0};
switch (1Param)
{
case FD_ACCEPT:
{
s1=::accept(s,(SOCKADDR*)&add1,(int*)sizeof(add1));
n=n+1;
str13.Format("有%d客户已经连接上了",n);
GetDlgItem(IDC_EDIT1)->SetWindowText(str13);
str13+=::inet_ntoa(add1.sin_addr);
str13+="登陆\r\n";
GetDlgItem(IDC_EDIT1)->SetWindowText(str13);
}
break;
case FD_READ:
{
CString num="";
::recv(s1,cs,100,0);
GetDlgItem(IDC_EDIT1)->SetWindowText(num);
num+="\r\n";
num+=(LPTSTR)::inet_ntoa(add1.sin_addr);
num+="对你说:";
num+=(LPTSTR)cs;
GetDlgItem(IDC_EDIT1)->SetWindowText(num);
}
break;
}
}
它的错误显示是:
Compiling...
TCP服务器程序Dlg.cpp
D:\crb\TCP服务器程序\TCP服务器程序Dlg.cpp(179) : error C2059: syntax error : 'bad suffix on number'
D:\crb\TCP服务器程序\TCP服务器程序Dlg.cpp(179) : error C2146: syntax error : missing ')' before identifier 'Param'
D:\crb\TCP服务器程序\TCP服务器程序Dlg.cpp(179) : error C2059: syntax error : ')'
D:\crb\TCP服务器程序\TCP服务器程序Dlg.cpp(180) : error C2065: 'Param' : undeclared identifie
D:\crb\TCP服务器程序\TCP服务器程序Dlg.cpp(180) : warning C4060: switch statement contains no 'case' or 'default' labels
D:\crb\TCP服务器程序\TCP服务器程序Dlg.cpp(181) : error C2046: illegal case
D:\crb\TCP服务器程序\TCP服务器程序Dlg.cpp(183) : error C2065: 's1' : undeclared identifier
D:\crb\TCP服务器程序\TCP服务器程序Dlg.cpp(183) : error C2065: 's' : undeclared identifier
D:\crb\TCP服务器程序\TCP服务器程序Dlg.cpp(183) : error C2065: 'add1' : undeclared identifier
D:\crb\TCP服务器程序\TCP服务器程序Dlg.cpp(184) : error C2065: 'n' : undeclared identifier
有个程序的一部分 不懂错误怎么解决:急!!!
答案:2 悬赏:60
解决时间 2021-03-12 13:57
- 提问者网友:枫涩帘淞幕雨
- 2021-03-12 07:56
最佳答案
- 二级知识专家网友:一场云烟
- 2021-03-12 08:27
你用的
switch (1Param)
这个1Param是从哪里来的,标识符(变量名)不能以数字开头(下划线或者字面开头,下划线字母数字的组合)
switch (1Param)
这个1Param是从哪里来的,标识符(变量名)不能以数字开头(下划线或者字面开头,下划线字母数字的组合)
全部回答
- 1楼网友:寂寞的炫耀
- 2021-03-12 09:28
在valgrind中,我们并不是对所有的“错误”感兴趣,比如很多库中的“错误”,所以要用suppression的方法使我们不感兴趣的错误不显示出来。系统有默认的suppression file "$prefix/lib/valgrind/default.supp.", 自己也可以写suppression file。 当使用选项-v时,在report时显示出所有使用的suppression,就是--6435-- used_suppression: 15 dl-hack3-cond-1
。
我要举报
如以上问答内容为低俗、色情、不良、暴力、侵权、涉及违法等信息,可以点下面链接进行举报!
大家都在看
推荐资讯