Hello!
scanf("%i", &reverse_sort); The compiler curses the incompatibility of the specifier and the input data:
/home/yura/gitclone/c_git/arr_sort.c|15| warning: format "% i"
Hello!
scanf("%i", &reverse_sort); The compiler curses the incompatibility of the specifier and the input data:
/home/yura/gitclone/c_git/arr_sort.c|15| warning: format "% i"
One of the cases when different parts of the standard are tightened at different speeds. There is no specifier for bool variables yet. The correct way to do what you want is:
int temp; bool reverse_sort; scanf("%i", &temp); reverse_sort = temp; char better? For me, on the contrary, with int fuss is less, and efficiency is more :) - user6550_Bool not defined as an int in this implementation. Think about what will be with the value 257 . - VladDint instead of bool , as it has been done in C for the last 45 years. - Mark Shevchenko%I is not the same as %i . In this case, %i should be used. - megaThere is no such format. Read int - and then bring it to bool .
stdbool.h they are clearly defined as 0 and 1. - user6550true . But only while we are talking about values, and not about pointers, as is the case with scanf() . - user6550Source: https://ru.stackoverflow.com/questions/426948/
All Articles
_Bool? - user6550scanfdoes not know how bool. But we will wait for the experts. - VladDint:-) If the situation allows, of course. - user6550