- 2

Why "=="?

"The operator "=" will not work as expected because it serves to attribute value." Then, use == to equality comparison.

25th Oct 2017, 12:50 AM
Jaqueline Karina
Jaqueline Karina - avatar
7 Answers
+ 5
= is an assignment operator already. Unless you wanna make assignment operators "->" gor example
25th Oct 2017, 5:16 AM
👑 Prometheus 🇾🇬
👑 Prometheus 🇾🇬 - avatar
+ 3
Thanks all:)
25th Oct 2017, 3:20 PM
Jaqueline Karina
Jaqueline Karina - avatar
+ 2
Hello Jaqueline, Your name sounds familiar to me.. so I'll to take the risk of answer you in Brazilian Portuguese, okay ? But if others are reading this question and also wanna know the answer, the operator " == " is a boolean expressions and compare if something ia true or not. You can read this: ___(A)_____ == _____(B)______: If was true that (A) is equal (B) ... than: (do s something). The operator " = " is common used to define something. example number = int (2) print (number) >>>> 2 ~~~~~~~~~~~~~~~~~ Oi Jaqueline, Seu nome soa familiar, entĂŁo eu vou me arriskar respondĂ©-la em Portugues do Brazil, tudo bem ? O operador == Ă© para comparar sentenças, ele responde se o valor Ă© verdadeiro ou falso. Lembra de lĂłgica ? Nem todo mundo estuda isso, mas os operadores == tem a função de comparar o valor lĂłgico da sentença. Isso Ă© muito Ăștil quando vocĂȘ precisa tomar decisĂ”es em cima de outras dependentes do "input" ou da resposta do usuĂĄrio.
25th Oct 2017, 1:39 AM
â–ČTopGun â–Č
â–ČTopGun â–Č - avatar
+ 2
if u want to know why == its a syntax / thought u can take it as below : suppose its in code - if a==h : do this now compiler will check if the value of a and h are equal... so first qual to check a's value next for h's value... like this a=5=h.... interpreted as a==h.. now as it is a syntax provoked by a certain direction of thought of how check two values its not 100% logical to everyone..
25th Oct 2017, 5:20 AM
sayan chandra
sayan chandra - avatar
+ 1
this is so because this is a c++ there =karna assignment and == means giving a particular value .
10th Mar 2018, 2:53 PM
Deepak Deep
Deepak Deep - avatar
0
= is assigning operator to assign value it works from right to left x=4 4(right) is assigned to x(left) == is checking operator for values / types both for rhs and lhs
25th Oct 2017, 5:06 AM
sayan chandra
sayan chandra - avatar
0
Hiii
9th Sep 2019, 6:08 AM
Bharat Reddy
Bharat Reddy - avatar