KnowledgeHub
Questions
Tags
Users
Search
Alex Rivera
|
Logout
Edit Question
Title
Body
This is allowed: int a, b, c; a = b = c = 16; string s = null; while ((s = "Hello") != null) ; To my understanding, assignment s = ”Hello”; should only cause “Hello” to be assigned to s , but the operation shouldn’t return any value. If that was true, then ((s = "Hello") != null) would produce an error, since null would be compared to nothing. What is the reasoning behind allowing assignment statements to return a value?
Tags (comma-separated)
Save Edits
Cancel