P
pete
char ch;
int i;
scanf("%c",&i);
scanf("%d",&ch);
After reviewing your above explanation along with the
code again I see that you are referring to the scanf statement instead
of the printf statement, however I would not say that the results are
UB. They would most certainly not be the intended results, however I
think that it would be perfectly defined.
Not defined at all.
scanf("%d",&ch) is going to treat (&ch)
as though it were the address of an int type object.
That means that scanf may write to more than one byte
when there is only one byte of memory reserved there.