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.
This comment is hidden because it contains spoiler information about the solution
everything was much easier than I thought at first
This comment is hidden because it contains spoiler information about the solution
This comment is hidden because it contains spoiler information about the solution
in most cases yes, but there is exceptions such as emmbeded devices with limited amount of memory. I think you need to write ur code according to the platform y're writting for
This comment is hidden because it contains spoiler information about the solution
This comment is hidden because it contains spoiler information about the solution
asprintf()
is a Linux function, not in standard C or POSIX. you must either declare it manually, or#define _GNU_SOURCE
before you#include <stdio.h>
The tests free it. It's always the case when you must return a heap allocated array / string (you cannot free it yourself: where would you? After return, the statement is not executed, before return then you would return a pointer to something not allocated anymore).
Why is the memory pointed to by r not released at the end of the function
No, the computer will exit the function after it executes one of the return statements, so there is no danger that it will try to return multiple values.
This comment is hidden because it contains spoiler information about the solution
This comment is hidden because it contains spoiler information about the solution
This comment is hidden because it contains spoiler information about the solution
This comment is hidden because it contains spoiler information about the solution
Loading more items...