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 / varsha vilas kalebag
== assignment operator
= equal to
Is This Answer Correct ? | 8 Yes | 17 No |
Describe friend function & its advantages.
What is struct c++?
What is a modifier in c++?
What does it mean to declare a member function as static?
I was a c++ code and was asked to find out the bug in that. The bug was that he declared an object locally in a function and tried to return the pointer to that object. Since the object is local to the function, it no more exists after returning from the function. The pointer, therefore, is invalid outside.
Why do we use pointers in c++?
What are friend classes? What are advantages of using friend classes?
What is a far pointer? where we use it?
What happens when you make call 'delete this;'?
What are dynamic type checking?
Why c++ is created?
Define whitespace in C++.