Artificial intelligent assistant

未初期化変数を使用する部分を含む式は全体として動作未定義か? int n; int ret_scanf; do { ret_scanf = scanf("%d", &n); if(ret_scanf != 1)// while(getchar()!='\n');// } while(n < 0 || ret_scanf != 1);// `int` `n` `n < 0 || ret_scanf != 1` `n < 0` `n` > The value of an object with automatic storage duration is used while it is indeterminate `ret_scanf` `0` `ret_scanf != 1` `n < 0` `n` `ret_scanf != 1 || n < 0`



c11

> 3.4.3
>
> 1. **undefined behavior**
> behavior, upon use of a nonportable or erroneous program construct or of erroneous data, for which this International Standard imposes no requirements
>
> 2. NOTE Possible undefined behavior ranges from ignoring the situation completely with unpredictable results, to behaving during translation or program execution in a documented manner characteristic of the environment (with or without the issuance of a diagnostic message), to terminating a translation or execution (with the issuance of a diagnostic message).
>
>











>






****

xcX3v84RxoQ-4GxG32940ukFUIEgYdPy 04cc3250603479976a12df20c68192de