Is the following code well defined?
#include int ScanFirstOrSecond(const char *s, int *dest) { return sscanf(s, \"%d%d\", dest, dest); }
scanf() family functions execute the directions you leave them in the format string strictly in turn. So the first value will get read in, and then the second one, overwriting the first. Nothing UB here.
scanf()