3 ms·
You meant: while ((dst++) = (src++)) I believe.
by einpoklum 7y ago
You meant:
while ((dst++) = (src++))
I believe.
- Gibbon1 7y agowhile ((dst++) = (src++));
- billforsternz 7y agoBoth of these replies are missing the asterisks to indicate pointer indirection. Probably HN is eating each asterisk, treating it as emphasis or something. Also terse it may be, but this (assuming the missing asterisks are restored) is a good, idiomatic implementation of strcpy. Whether strcpy is good or evil is a separate discussion.