What does "empty string with semicolon" mean in C #?
1 answer
This is an empty statement . It is useful as a loop body:
while(!Condition()) ;
More common in a for-loop, where the body of the loop is completely embedded in the head of the loop.
Go to the last item in the linked list:
Node current = head;
for (; current.Next != null; current = current.Next) ;
return current;
This looks a little annoying, and I usually prefer to write a longer but more readable loop. C ++ people tend to insert stuff in the header of the loop often.
I'm sure this can come in handy in code generation scripts too.
+4
source to share