-2

For example:

while((*s1++=*s2++)! ='\0')

How can the assignment of *s2++ to *s1++ be compared with '\0'?

Adrian
  • 14,931
  • 9
  • 45
  • 70
Rajesh Shaw
  • 547
  • 1
  • 4
  • 9
  • 2
    Possible duplicate of [What is the result of an assignment expression in C?](http://stackoverflow.com/questions/16567622/what-is-the-result-of-an-assignment-expression-in-c) – Stephen C Oct 03 '16 at 04:04
  • How would I know that this is a duplicate question – Rajesh Shaw Oct 03 '16 at 04:14
  • By searching before you asked, and reading the search results. For example, if you had searched for "[c] assignment expression" you would have found the Q&A that I found. – Stephen C Oct 03 '16 at 04:45

1 Answers1

1

The value of an assignment expression is the value that was assigned to the left operand of the expression.

So what you have there is a test that the value assigned to *s1 is not equal to '\0'.

Stephen C
  • 698,415
  • 94
  • 811
  • 1,216