Web1 sep. 2011 · The writer's of your libc have decided that the return value of scanf should not be ignored in most cases, so they have given it an attribute telling the compiler to give you a warning. If the return value is truly not needed, then you are fine. Web18 jun. 2024 · Return value 1-3) Number of receiving arguments successfully assigned (which may be zero in case a matching failure occurred before the first receiving argument was assigned), or EOF if input failure occurs before the first receiving argument was assigned. You are ignoring that return value. Replace scanf ( "%d", &age); by
C - error: ignoring return value of scanf? - Stack Overflow
Web18 apr. 2024 · 解决方案. It means that you do not check the return value of scanf. It might very well return 1 (only a is set) or 0 (neither a nor b is set). The reason that it is not shown when compiled without optimization is that the analytics needed to see this is not done unless optimization is enabled. Web26 jan. 2024 · 方法①: 把scanf改成:scanf_s 这是VS 编译器 特有,既然觉得scanf ()不安全,那它就自己定义了一个scanf_s ()。 方法②: 编译器错误提示的原因至于VS中 … south street surgery bishop\u0027s stortford herts
ignoring return value (C Programming) - Stack Overflow
Web21 jun. 2024 · warning: ignoring return value of ‘scanf’, declared with attribute warn_unused_result [-Wunused-result] scanf("%d",&f); 这个是C语言当中常见的错误,意思是 对于输入的scanf参数的内容,没有进行类型判断,所以才会产生这个问题. Web5 jun. 2024 · It means that you do not check the return value of scanf. It might very well return 1 (only a is set) or 0 (neither a nor b is set). The reason that it is not shown when compiled without optimization is that the analytics needed to see this is not done unless optimization is enabled. Web19 jul. 2024 · scanf返回值问题 st 1 1 2 发布于 2024-07-19 新手上路,请多包涵 pta平台scanf在平台给的样例里怎么解决ignoring return value of ‘scanf’, declared with attribute warn_unused_result 的问题。 a.c:43:5: warning: ignoring return value of ‘scanf’, declared with attribute warn_unused_result [-Wunused-result] scanf ("%d", &N); ^ ~ ~ ~~~~ 在pta … south street surgery bishop\\u0027s stortford