C Tidbit 15 Nov, 2006 C Tidbit

The assignment operator returns something! In the case of a character, it returns the character that was assigned. So, it is useful to write code this way:

while ((to[i] = from[i]) != '\0')


Tags  ·   C programming  ·   tidbit  ·   Show Comments ▾


     
Original design for Tumblr crafted by Prashanth Kamalakanthan.
Adapted for Tumblr & Jekyll by Sai Charan. Customized theme available on Github.

Sai Charan's blog by Sai Charan is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 3.0 Unported License.
Creative Commons License