-2

For example:

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

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

Adrian
  • 14,346
  • 8
  • 42
  • 69
Rajesh Shaw
  • 487
  • 1
  • 4
  • 7
  • 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
  • 669,072
  • 92
  • 771
  • 1,162