What is the difference between = and == in C?
Answer Posted / chandan
= Assignment Operator
== Comparision Operator
One Intresting Difference between these two is in the =
operator the left side can not be a const, while in == we
can place Const in either side.
eg. x = 5 //correct
5 = x // Incorrect
but X == 5 // CORRECT
5 == X // Correct and Preffered to use left value
as constant to avoid the unwanted bug.
| Is This Answer Correct ? | 46 Yes | 7 No |
Post New Answer View All Answers
What is operators in c++?
Explain container class.
What is the function to call to turn an ascii string into a long?
daily Routine of father
What is a sequence in c++?
What is a static member?
What do you mean by persistent and non persistent objects?
What are signs of manipulation?
What is the difference between an external iterator and an internal iterator?
What is format for defining a structure?
What are the advantages of using friend classes?
What is setfill c++?
What is the best c++ compiler?
Explain the difference between static and dynamic binding of functions?
How do you print a string on the printer?