请帮我看一下,这个语法含义是这样的?
if((int)(bdstr[i]^bdstr[i+len/2])!=0)
是判断bdstr[i]与bdstr[i+len/2])求异或后的值是否是0,对吗?但是运行结果是错误的,这句话含义对吗?下面是整个函数
#include <iostream>
#include <iomanip>
#include <math.h>
#include <string>
using namespace std;
/*---------------------------------------------*/
bool check(char *bdstr)
{
bool FALSE=0;
bool TRUE=1;
bool IsTrue=TRUE;
int i;
char sum;
int len;
len=strlen(bdstr);
for (i=0;i<len/2;i++)
{
//sum^=buf[i];
if((int)(bdstr[i]^bdstr[i+len/2])!=0)
{
IsTrue=FALSE;
break;
}
}
cout<<IsTrue<<endl;
return IsTrue;
}
void main()
{
int sum;
char *p="101010";
check(p);
}
是判断bdstr[i]与bdstr[i+len/2])求异或后的值是否是0,对吗?但是运行结果是错误的,这句话含义对吗?下面是整个函数
#include <iostream>
#include <iomanip>
#include <math.h>
#include <string>
using namespace std;
/*---------------------------------------------*/
bool check(char *bdstr)
{
bool FALSE=0;
bool TRUE=1;
bool IsTrue=TRUE;
int i;
char sum;
int len;
len=strlen(bdstr);
for (i=0;i<len/2;i++)
{
//sum^=buf[i];
if((int)(bdstr[i]^bdstr[i+len/2])!=0)
{
IsTrue=FALSE;
break;
}
}
cout<<IsTrue<<endl;
return IsTrue;
}
void main()
{
int sum;
char *p="101010";
check(p);
}
...全文
相关推荐
{合同法律法规}语法这术语可有三种含义语法规律.pdf
{合同法律法规}语法这术语可有三种含义语法规律.pdf
日语二级语法总结190
うちに- **含义**: 趁……,利用现在的机会或状态。- **例句**: - 熱いうちに、召し上がってください。(请趁热吃。)#### 11.
TOEFL-Junior语言形式与含义-语法点分类练习.pdf
TOEFL-Junior语言形式与含义-语法点分类练习从给定的文件中,我们可以看到,这是一个关于TOEFL-Junior语言形式与含义的语法点分类练习文件。
php正则表达式的基本语法总结
"这篇文档是关于PHP正则表达式的总结,主要讲解了基本的语法和特殊字符的使用,包括开始和结束标识'^'和'$',以及'*'、'+'、'?'等量词的含义,同时介绍了大括号'{n}'、'{n,}'、'{
coursera:帮我帮你
**基础语法**:包括变量、数据类型(如字符串、数字、布尔值、数组、对象)、流程控制(条件语句、循环)、函数等。2.


