为什么在中运行结果与实际不符?vc中为equal,equal,notequal,而实际上应该都为not equal
来源:学生作业帮 编辑:搜搜做题作业网作业帮 分类:综合作业 时间:2024/06/25 19:05:57
为什么在中运行结果与实际不符?vc中为equal,equal,notequal,而实际上应该都为not equal
#include
using namespace std;
//---------------
void main()
{cout
#include
using namespace std;
//---------------
void main()
{cout
![为什么在中运行结果与实际不符?vc中为equal,equal,notequal,而实际上应该都为not equal](/uploads/image/z/18286965-45-5.jpg?t=%E4%B8%BA%E4%BB%80%E4%B9%88%E5%9C%A8%E4%B8%AD%E8%BF%90%E8%A1%8C%E7%BB%93%E6%9E%9C%E4%B8%8E%E5%AE%9E%E9%99%85%E4%B8%8D%E7%AC%A6%3Fvc%E4%B8%AD%E4%B8%BAequal%2Cequal%2Cnotequal%2C%E8%80%8C%E5%AE%9E%E9%99%85%E4%B8%8A%E5%BA%94%E8%AF%A5%E9%83%BD%E4%B8%BAnot+equal)
明显不对,这种原始的字符串,直接用==来进行逻辑判断实际上判断的是这两个字符串的首地址是否相等,而不是字符串的内容是否相等.
不是同一对象的字符串,在内存的地址是不同的,用==来判断当然不相等.要判断字符串内容是否相等,要用专门的函数来比较:
#include
strcmp(str1,str2)==0?"":"not;
不是同一对象的字符串,在内存的地址是不同的,用==来判断当然不相等.要判断字符串内容是否相等,要用专门的函数来比较:
#include
strcmp(str1,str2)==0?"":"not;
equal
be born equal中的equal为形容词吗,为什么不用equallly,
数据结构中的LocateElem(La,e,equal)中的equal在C语言中如何定义啊
equal词性one and one is equal to two.中equal是什么词性?
equal to 与equal with比较
I believe that all mankind is created equal 此句中equal在句子中做什么成
We were born equal.中equal为什么不能用副词修饰整句,而是主语补足语?
请问:All mankind is created equal.句中equal 是什么词性?怎么辨别?
all men are born equal还是were born equal?为什么?
be equal to与equal to意思上的区别
The past does not equal the
love and marriage,equal or not?