#include <stdio.h>
int main(void)
{
char b[5];
scanf("%4s%4s", b, b);
//My input: "qwer<Enter>sgsh<Enter>"
printf("%s", b);
//Output: sgsh
}
C99: Between the previous and next sequence point an object shall have its stored value modified at most once by the evaluation of an expression.
In this case, I am modifying the value of b
twice
. Isn't it undefined behavior
?