for(;scanf("%d", &d);){ does not work well

Asked 2 years ago, Updated 2 years ago, 33 views

The code below is a program that sequentially stores values entered using a bidirectional list.
This code allows you to enter it, but -10000 does not leave for .What is the cause?

Please let me know if there are any other mistakes.

#include

c

2022-09-30 19:21

1 Answers

scanf return value is

Number of successfully substituted receive arguments (a match failure may result in zero if the match fails before the first receive argument is substituted), or EOF if the input failure occurs before the first receive argument is substituted.

Therefore, -10000 is never returned.


2022-09-30 19:21

If you have any answers or tips


© 2024 OneMinuteCode. All rights reserved.