What is the difference between = and == in C?
Answers were Sorted based on User's Feedback
Answer / aman
* First of all = is a assignment operator and == is a comparision operator.
* = operator is used to assign value to a variable and == operator is used to compare two variable or constants.
* The left side of = operator can not be a constant, while for == operator both sides can be operator.
http://www.cplusplus.com/forum/general/18183/
| Is This Answer Correct ? | 3 Yes | 0 No |
Answer / datta khilari
= operator is assignment operator
== is operator comparision two values
| Is This Answer Correct ? | 4 Yes | 2 No |
Answer / kiranmai
= is used to assign the value it is called assignment operator where as
== is used to compare whether the left side and right side values are equal or not
| Is This Answer Correct ? | 0 Yes | 0 No |
'=' assigns a value to a variable whereas '==' checks whether two values are equal or not
| Is This Answer Correct ? | 0 Yes | 0 No |
Answer / nashiinformaticssolutions
=: Assignment operator (e.g., x = 10).
==: Equality comparison operator (e.g., if (x == 10)).
| Is This Answer Correct ? | 0 Yes | 0 No |
Answer / nashiinformaticssolutions
== checks equality; = assigns values.
| Is This Answer Correct ? | 0 Yes | 0 No |
Answer / glibwaresoftsolutions
=: Assignment operator (e.g., x = 10).
==: Equality comparison operator (e.g., if (x == 10)).
| Is This Answer Correct ? | 0 Yes | 0 No |
=: Assignment operator (e.g., x = 10).
==: Equality comparison operator (e.g., if (x == 10)).
| Is This Answer Correct ? | 0 Yes | 0 No |
Answer / varsha vilas kalebag
== assignment operator
= equal to
| Is This Answer Correct ? | 8 Yes | 17 No |
Explain method of creating object in C++ ?
Can a class be static in c++?
What are c++ storage classes?
How many types of casting are there in C++? When is a dynamic cast,static_cast,reinterpret cast used?
how many trys can we write in one class
What does std :: flush do?
When to use “const” reference arguments in a function?
How a modifier is similar to mutator?
What is slicing?
Tell me an example where stacks are useful?
Of the numbers 12 23 9 28 which would be at the top of a properly implemented maxheap a) 28 b) 9 c) Any of them could be
C is to C++ as 1 is to a) What the heck b) 2 c) 10