networking · beginner · ~15 min

Is this the last chunk?

Detect the terminating zero-chunk.

Challenge

A chunk size of 0 marks the end of a chunked body. Implement int is_last_chunk(const char *hexsize) returning 1 if the hex size parses to 0, else 0.

Starter code

#include <stdlib.h>

int is_last_chunk(const char *hexsize) {
    /* TODO */
    return 0;
}

Solve this exercise in the browser editor — compile and run against the test harness, no setup required.