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
Explain explicit container.
If a round rectangle has straight edges and rounded corners, your roundrect class inherits both from rectangle and from circle, and they in turn both inherit from shape, how many shapes are created when you create a roundrect?
Are there any special rules about inlining?
Is c++ a float?
When should I use unitbuf flag?
When we use Abstract Class and when we use Interface?where we will implement in real time?
What is the basic of c++?
What is prototype in c++ with example?
Are strings immutable in c++?
Why is c++ considered difficult?
What is increment operator in c++?
Can we specify variable field width in a scanf() format string? If possible how?
When do we run a shell in the unix system?
Will a catch statement catch a derived exception if it is looking for the base class?
Which header file allows file i/o with streams a) fileio.h b) iostream.h c) fstream.h