#include "dos.h"
#include "stdlib.h"
#include "stdio.h"
#define PORT 0
void SendFile(char *fname);
void Send(int s);
void SendFileName(char *fname);
void ReceiveFile();
void GetFileName(char *f);
void InitPort(int port,unsigned char para);
void SendPort(int port,char c);
int ReadPort(int port);
int CheckState(int port);
int Receive(int port,int *G);
void main(int argc,char *argv[])
{
if(argc<2){
printf("Please input R(receive) or S(sent) parametre:");
exit(1);
}
InitPort(PORT,231);
if(*argv[1]=='S')
SendFile(argv[2]);
else if(*argv[1]='R')
ReceiveFile();
else
{
printf("Error parament.Please input again.");
exit(1);
}
}
void SendFile(char *fname)
{
FILE *fp;
int ch,s;
if((fp=fopen(fname,"rb"))==NULL)
{
printf("Can't open the file.\n");
exit(1);
}
SendFileName(fname);
do{
ch=(int getc(fp) );
if(ferror(fp)){
printf("Error reading file.\n ");
break;
}
s=ch%16;
Send(s);
s=ch/16;
Send(s);
}
while(!feof(fp));
s=46;
Send(s);
Send(s);
fclose(fp);
}
void Send(s)
int s;
{
int G;
SendPort(PORT,s);
G=ReadPort(PORT);
if(s!=G)
s=s+16;
do{
SendPort(PORT,s);
G=ReadPort(PORT);
}
while(s!=G);
}
具体问题如图
error C2065: 's' : undeclared identifier 来个大神帮帮忙 谢谢了
答案:2 悬赏:10 手机版
解决时间 2021-02-04 13:21
- 提问者网友:呐年旧曙光
- 2021-02-03 20:56
最佳答案
- 五星知识达人网友:千杯敬自由
- 2021-02-03 21:44
#include "dos.h"
#include "stdlib.h"
#include "stdio.h"
#define PORT 0
void SendFile(char *fname);
void Send(int s);
void SendFileName(char *fname);
void ReceiveFile();
void GetFileName(char *f);
void InitPort(int port,unsigned char para);
void SendPort(int port,char c);
int ReadPort(int port);
int CheckState(int port);
int Receive(int port,int *G);
void main(int argc,char *argv[])
{
if(argc<2){
printf("Please input R(receive) or S(sent) parametre:");
exit(1);
}
InitPort(PORT,231);
if(*argv[1]=='S')
SendFile(argv[2]);
else if(*argv[1]='R')
ReceiveFile();
else
{
printf("Error parament.Please input again.");
exit(1);
}
}
void SendFile(char *fname)
{
FILE *fp;
int ch,s;
if((fp=fopen(fname,"rb"))==NULL)
{
printf("Can't open the file.\n");
exit(1);
}
SendFileName(fname);
do{
ch=(int getc(fp) );
if(ferror(fp)){
printf("Error reading file.\n ");
break;
}
s=ch%16;
Send(s);
s=ch/16;
Send(s);
}
while(!feof(fp));
s=46;
Send(s);
Send(s);
fclose(fp);
}
void Send(int s) //判断是这里的问题,已修改
{
int G;
SendPort(PORT,s);
G=ReadPort(PORT);
if(s!=G)
s=s+16;
do{
SendPort(PORT,s);
G=ReadPort(PORT);
}
while(s!=G);
}
#include "stdlib.h"
#include "stdio.h"
#define PORT 0
void SendFile(char *fname);
void Send(int s);
void SendFileName(char *fname);
void ReceiveFile();
void GetFileName(char *f);
void InitPort(int port,unsigned char para);
void SendPort(int port,char c);
int ReadPort(int port);
int CheckState(int port);
int Receive(int port,int *G);
void main(int argc,char *argv[])
{
if(argc<2){
printf("Please input R(receive) or S(sent) parametre:");
exit(1);
}
InitPort(PORT,231);
if(*argv[1]=='S')
SendFile(argv[2]);
else if(*argv[1]='R')
ReceiveFile();
else
{
printf("Error parament.Please input again.");
exit(1);
}
}
void SendFile(char *fname)
{
FILE *fp;
int ch,s;
if((fp=fopen(fname,"rb"))==NULL)
{
printf("Can't open the file.\n");
exit(1);
}
SendFileName(fname);
do{
ch=(int getc(fp) );
if(ferror(fp)){
printf("Error reading file.\n ");
break;
}
s=ch%16;
Send(s);
s=ch/16;
Send(s);
}
while(!feof(fp));
s=46;
Send(s);
Send(s);
fclose(fp);
}
void Send(int s) //判断是这里的问题,已修改
{
int G;
SendPort(PORT,s);
G=ReadPort(PORT);
if(s!=G)
s=s+16;
do{
SendPort(PORT,s);
G=ReadPort(PORT);
}
while(s!=G);
}
全部回答
- 1楼网友:孤老序
- 2021-02-03 22:09
把你的inorder和wuserlevel的定义都放到函数的一开始
给你标注一下问题
/获取等级
word cuseritemelement::getexperiencelevel(dword dwexperience)
{
if (dwexperience>0l)
{
//变量定义
dword dwincrease=0l;
dword dwlevelvalue=0l;
//等级计算
for (word wuserlevel=1;wuserlevel<60l;wuserlevel++)
{//这里的wuserlevel的生命周期之在for循环内,出了for循环就不认识它了
dwincrease+=wuserlevel*30l;
dwlevelvalue=dwlevelvalue+dwincrease;
if (dwexperience
我要举报
如以上回答内容为低俗、色情、不良、暴力、侵权、涉及违法等信息,可以点下面链接进行举报!
点此我要举报以上问答信息
大家都在看
推荐资讯