Loading collection data...
Collections are a way for you to organize kata so that you can create your own training routines. Every collection you create is public and automatically sharable with other warriors. After you have added a few kata to a collection you and others can train on the kata contained within the collection.
Get started now by creating a new collection.
first point:
When the compiler encounters a function call for which it does not find a function declaration, it assumes the function has this prototype:
int func_name ()
.strdup()
is sadly not yet part of standard C (it will be added in C23). This is why the compiler does not find it in<string.h>
: it is a POSIX extension. you have to#define _GNU_SOURCE
before#include <string.h>
to make it visible:second point: your code is almost correct, but has 2 mistakes:
next time just use
This comment is hidden because it contains spoiler information about the solution