
Write free_str_array, which releases every string of a NULL-terminated char **, then releases the array of pointers itself, and returns how many strings it held.
free_str_array({"git", "gcc", "make", NULL})Expected result
in=[git][gcc][make] freed=3For your own tracking. Tests grade your code.
free_str_array({"head", "", "tail", NULL})Expected result
in=[head][][tail] freed=3free_str_array({NULL})Expected result
in= freed=0free_str_array(NULL)Expected result
in=null freed=0free_str_array(64 strings of 1 byte, then NULL)Expected result
built=64 len=1 freed=64Expected files
free_str_array.cAllowed functions
freeAllowed headers

Write free_str_array, which releases every string of a NULL-terminated char **, then releases the array of pointers itself, and returns how many strings it held.
free_str_array({"git", "gcc", "make", NULL})Expected result
in=[git][gcc][make] freed=3For your own tracking. Tests grade your code.
free_str_array({"head", "", "tail", NULL})Expected result
in=[head][][tail] freed=3free_str_array({NULL})Expected result
in= freed=0free_str_array(NULL)Expected result
in=null freed=0free_str_array(64 strings of 1 byte, then NULL)Expected result
built=64 len=1 freed=64Expected files
free_str_array.cAllowed functions
freeAllowed headers

Run the tests to grade your code
Build your code, then check each test here. Open a result to inspect its output.
v0.40: Create exercises. Challenge the community.
Meet Studio →