Skip to content
KALANBLON
Show contents

Chapter 7 of 7 · 10 min

Quiz: robust, safe C

Undefined behaviour, sanitizers, bounded copies and the word counter: last quiz of the advanced C path. You need 70 % correct answers to pass the course.

Quiz

5 questions · pass mark: 70%

  1. 1.Which of these cases are undefined behaviour in C? (several answers)

    Several answers possible

  2. 2.Which tool detects a read outside an array's bounds and gives the faulty line?

    One answer

  3. 3.snprintf(buf, 20, "%s", text) returns 29. What does that mean?

    One answer

  4. 4.Complete the check that stops n * t overflowing before a malloc.

    Complete the code

    if (t != 0 && n > ________ / t) {
        return NULL;
    }
  5. 5.Why store getchar's result in an int rather than a char?

    One answer

Your progress is saved on this device. Create a free account to keep your progress on all your devices.