Skip to the task
Layout
Back to classic view

You are looking ahead. Your place is still task 1: About.

CHECKTask 11 of 17 · step 3: Questions 7–12assert and input
assert and input in practice/06/

What is wrong?

Details & hint
int age = read_int("Age: ");
assert(age >= 0);

Stuck? assert checks the programmer's mistakes, not input: in Release (NDEBUG) it disappears. Check input with a while loop. (Topic 5)

practice 06 CMakeLists.txt Code Diff
UNCHANGED This step does not change this file.
add_executable(p06_temperatures main.c)
target_link_libraries(p06_temperatures PRIVATE course_input)
add_executable(p06_search search.c)
add_executable(p06_hall hall.c)