新药研发的步骤:[JSP]这样的区别在哪里?

来源:百度文库 编辑:杭州交通信息网 时间:2024/04/28 01:43:25
代码1:
int n=0;
while(n!=-1&&(Forth<=4))
{

n=RandFile.readByte();
if(n=='\n')
{
EnterPosition=RandFile.getFilePointer();
Forth++;
}
}

与代码2:
int n=0;
while((n=RandFile.readByte())=-1&&(Forth<=4))
{

if(n=='\n')
{
EnterPosition=RandFile.getFilePointer();
Forth++;
}
}
讲一下区别?

代码2是错误的,(n=RandFile.readByte())=-1 应该是 (n=RandFile.readByte())!=-1 ,其它好像没设什么区别。