In C and C++ you need to consider the possibility that a == b
, which would certainly render it unsafe. And in C++ you also need to exclude the possibility that a
and b
refer to the same name, i.e. that at least one is a reference. But excluding that, and assuming *a
and *b
are themselves valid, yes, each object is evaluated and assigned once.
14
solved Is *a++ = *b++ = 0 safe