+ 1
What is the difference between = and == ? And when they are used ???
for both c and c++
2 odpowiedzi
+ 2
"=" for 'equals' and "==" for 'is equal to'. If you read your condition with those phrases then you'll better understand the condition you're trying to prove.
The main difference is that the "=" is an assignment operator and the "==" sign tests a condition.
Example: i = num1 + 1. (Assigns num1 + 1 to i)
Example: num1 == num2. (Checks if num1 is equal to num2)
+ 2
= assigns a value to a variable
== equality, if this is the same as that